R
Ruth
I have been working for a couple of hours now trying different ways to
solve this problem and I'm out of ideas (or tired). :-/
Here's what I'm trying to do:
On a form I have a section with six checkboxes that represent 6
different mailing lists an organization can subscribe to: MailList01,
MailList02, etc.
I have a seventh checkbox named MailListOmit for orgs that want to opt
out of mailings.
If MailListOmit is checked, when the user attempts to click any one of
the MailList checkboxes, I want to return a dialog box that says,
"This organization has chosen to not receive mailings," and reset the
checkbox to False.
If a user attempts to click MailListOmit and any of the MailList
checkboxes are checked, I want to return a dialog box (with the
options Yes, No or Cancel that says, "Checking this box will remove
all current mail list selections." If yes, it will set MailListOmit to
True and clear the MailList check box values. If no or cancel,
MailListOmit will remain False and MailList checkboxes that are
currently checked will remain.
If no MailList checkboxes are checked, the user would be able to check
the MailListOmit checkbox without a prompt.
Here's the code I've written for the first part:
Private Sub MailList01_BeforeUpdate(Cancel As Integer)
With Me
If (Me.MailListOmit = True) Then
MsgBox "This organization has chosen to not receive
mailings.", 0, "No Mailings!"
Me.MailListOmit.SetFocus
Me.MailList01.Enabled = False
Else
Me.MailList01.Enabled = True
End If
End With
End Sub
I get this error:
Run-time error '2108':
You must save the field before you execute the GoToControl action, the
GoToControl method. or the SetFocus method.
Obviously I'm a coding novice... but I'm trying! Suggestions? TIA!
solve this problem and I'm out of ideas (or tired). :-/
Here's what I'm trying to do:
On a form I have a section with six checkboxes that represent 6
different mailing lists an organization can subscribe to: MailList01,
MailList02, etc.
I have a seventh checkbox named MailListOmit for orgs that want to opt
out of mailings.
If MailListOmit is checked, when the user attempts to click any one of
the MailList checkboxes, I want to return a dialog box that says,
"This organization has chosen to not receive mailings," and reset the
checkbox to False.
If a user attempts to click MailListOmit and any of the MailList
checkboxes are checked, I want to return a dialog box (with the
options Yes, No or Cancel that says, "Checking this box will remove
all current mail list selections." If yes, it will set MailListOmit to
True and clear the MailList check box values. If no or cancel,
MailListOmit will remain False and MailList checkboxes that are
currently checked will remain.
If no MailList checkboxes are checked, the user would be able to check
the MailListOmit checkbox without a prompt.
Here's the code I've written for the first part:
Private Sub MailList01_BeforeUpdate(Cancel As Integer)
With Me
If (Me.MailListOmit = True) Then
MsgBox "This organization has chosen to not receive
mailings.", 0, "No Mailings!"
Me.MailListOmit.SetFocus
Me.MailList01.Enabled = False
Else
Me.MailList01.Enabled = True
End If
End With
End Sub
I get this error:
Run-time error '2108':
You must save the field before you execute the GoToControl action, the
GoToControl method. or the SetFocus method.
Obviously I'm a coding novice... but I'm trying! Suggestions? TIA!