Hi!
I am working on a new database and the manager has a request that I am having issue with. There are 3 check boxes each with a corresponding text box. When a user marks the check box "yes" on the form, the text box needs to become required.
Check boxes:
Coder_Issue
Physician_Issue
Dept_Clinic_Issue
Text boxes:
Coder
Physician
Dept_Clinic
I have tried various things but I end up getting the msgbox as soon as the check box is selected (or it does nothing). It wants the text field entered before the box is checked. What I need is for it to give the message when the user clicks save and there is a check box marked but the text box is blank... Help???
Also- I showed the SetFocus line below but I cannot use it without getting a run-time error "2108'
This is the most recent attempt.
Private Sub Physician_Issue_BeforeUpdate(Cancel As Integer)
If Me.Physician_Issue.Value And Len(Trim(Me.Physician.Value & vbNullString)) = 0 Then
MsgBox "Physician Field Required"
Cancel = True
Me.Physician.SetFocus
End If
End Sub
I am working on a new database and the manager has a request that I am having issue with. There are 3 check boxes each with a corresponding text box. When a user marks the check box "yes" on the form, the text box needs to become required.
Check boxes:
Coder_Issue
Physician_Issue
Dept_Clinic_Issue
Text boxes:
Coder
Physician
Dept_Clinic
I have tried various things but I end up getting the msgbox as soon as the check box is selected (or it does nothing). It wants the text field entered before the box is checked. What I need is for it to give the message when the user clicks save and there is a check box marked but the text box is blank... Help???
Also- I showed the SetFocus line below but I cannot use it without getting a run-time error "2108'
This is the most recent attempt.
Private Sub Physician_Issue_BeforeUpdate(Cancel As Integer)
If Me.Physician_Issue.Value And Len(Trim(Me.Physician.Value & vbNullString)) = 0 Then
MsgBox "Physician Field Required"
Cancel = True
Me.Physician.SetFocus
End If
End Sub