D
datahead22
what I'm trying to do is get the user to select one of for check boxes
in an option group[contact_at] if they don't select one it should
cancel the sub and they get a message box telling them to make a
selection
then based on the users selection I need to check if a coresponding
text box is null if it is they must stop and populate the text field
before they can write the information to the tables.
What may make this more complicated is it's coming in the middle of a
bunch of other validation code.
I'm not sure this makes sense but it might when you look at the code
This is my latest attempt:
'This first section works fine
If IsNull([sources_count_residence1]) Then
MsgBox "Source's County of Residence is a Required Field"
Me![sources_count_residence1].SetFocus
Exit Sub
End If
'This is where the trouble begins
If IsNull(Me![contact_at]) Then
MsgBox "Please Select a Location to Contact Source At!"
Me![contact_at].SetFocus
Exit Sub
Select Case Me![contact_at]
Case 1
If IsNull([sources_home_phone1]) Then
MsgBox "Source's Home Phone is a Required Field"
Me![sources_home_phone1].SetFocus
End If
Exit Sub
Case 2
If IsNull([sources_cell_phone1]) Then
MsgBox "Source's Cell Phone is a Required Field"
Me![sources_cell_phone1].SetFocus
End If
Exit Sub
Case 3
If IsNull([sources_work_phone1]) Then
MsgBox "Source's Work Phone is a Required Field"
Me![sources_work_phone1].SetFocus
End If
Exit Sub
Case 4
If IsNull([sources_email_address1]) Then
MsgBox "Source's Email Address is a Required Field"
Me![sources_email_address1].SetFocus
End If
Exit Sub
End Select
'After this section I need to go back to...
If IsNull([sources_contact_method1]) Then
MsgBox "Source's Preferred Contact Method is a Required Field"
Me![sources_contact_method1].SetFocus
Exit Sub
End If
If IsNull([concern_desc1]) Then
MsgBox "Concern Description is a Required Field"
Me![concern_desc1].SetFocus
Exit Sub
End If
Sorry I know that's a lot of code but sure would appreciate the help
in an option group[contact_at] if they don't select one it should
cancel the sub and they get a message box telling them to make a
selection
then based on the users selection I need to check if a coresponding
text box is null if it is they must stop and populate the text field
before they can write the information to the tables.
What may make this more complicated is it's coming in the middle of a
bunch of other validation code.
I'm not sure this makes sense but it might when you look at the code
This is my latest attempt:
'This first section works fine
If IsNull([sources_count_residence1]) Then
MsgBox "Source's County of Residence is a Required Field"
Me![sources_count_residence1].SetFocus
Exit Sub
End If
'This is where the trouble begins
If IsNull(Me![contact_at]) Then
MsgBox "Please Select a Location to Contact Source At!"
Me![contact_at].SetFocus
Exit Sub
Select Case Me![contact_at]
Case 1
If IsNull([sources_home_phone1]) Then
MsgBox "Source's Home Phone is a Required Field"
Me![sources_home_phone1].SetFocus
End If
Exit Sub
Case 2
If IsNull([sources_cell_phone1]) Then
MsgBox "Source's Cell Phone is a Required Field"
Me![sources_cell_phone1].SetFocus
End If
Exit Sub
Case 3
If IsNull([sources_work_phone1]) Then
MsgBox "Source's Work Phone is a Required Field"
Me![sources_work_phone1].SetFocus
End If
Exit Sub
Case 4
If IsNull([sources_email_address1]) Then
MsgBox "Source's Email Address is a Required Field"
Me![sources_email_address1].SetFocus
End If
Exit Sub
End Select
'After this section I need to go back to...
If IsNull([sources_contact_method1]) Then
MsgBox "Source's Preferred Contact Method is a Required Field"
Me![sources_contact_method1].SetFocus
Exit Sub
End If
If IsNull([concern_desc1]) Then
MsgBox "Concern Description is a Required Field"
Me![concern_desc1].SetFocus
Exit Sub
End If
Sorry I know that's a lot of code but sure would appreciate the help