How do I run this validation code only if the Subform entry is needed?
--------------------
Private Sub DialUpRatePlan_Exit(Cancel As Integer)
If IsNull(Me.DialUpRatePlan) Or Me.DialUpRatePlan = "" Then
MsgBox "Please choose a Dial-Up Rate plan from the drop-down list", vbExclamation, "Required Field"
Cancel = True
End If
End Sub
--------------------
(I'm using this code on every "Required" field on Main & Subform fields)
Currently I have a Main form & multiple Subforms on a Tabbed form. The user enters:
- New records into the Main form (ALWAYS).
- New records into the Subform (SOMETIMES)(or only 1 out of the 3 subforms are needed)
How do I make sure that the Subform validation code DOES NOT run if the user did not need the other 2 subforms?
What's happening now is that when the Main form is closed, Access is prompting for the required subform data from the other 2 subforms, even though the User intentionally passed by them because they were not applicable to this record.
Thanks in advance for your help,
cw
--------------------
Private Sub DialUpRatePlan_Exit(Cancel As Integer)
If IsNull(Me.DialUpRatePlan) Or Me.DialUpRatePlan = "" Then
MsgBox "Please choose a Dial-Up Rate plan from the drop-down list", vbExclamation, "Required Field"
Cancel = True
End If
End Sub
--------------------
(I'm using this code on every "Required" field on Main & Subform fields)
Currently I have a Main form & multiple Subforms on a Tabbed form. The user enters:
- New records into the Main form (ALWAYS).
- New records into the Subform (SOMETIMES)(or only 1 out of the 3 subforms are needed)
How do I make sure that the Subform validation code DOES NOT run if the user did not need the other 2 subforms?
What's happening now is that when the Main form is closed, Access is prompting for the required subform data from the other 2 subforms, even though the User intentionally passed by them because they were not applicable to this record.
Thanks in advance for your help,
cw