G
gg
Continued from 8/2/05. I have a check box field in my Main form called
"PO_flag." On my subform, I have a field called "PO_no". If the PO_flag
field is checked (=True) the PO_no field on the subform must be required
(filled in). If not, the message will be MsgBox "You must enter a PO#." I
put the following code (thank you, Allen Browne) in the BeforeUpdate event of
the subform, not in the property section of the PO_no field (in subform):
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.Parent!PO_flag.Value Then
If IsNull(Me.PO_no) Then
Cancel=True
MsgBox "PO# required."
End If
End If
End Sub
When I check the box for PO_flag, and the PO_no in the subform line items
are blank, the MsgBox message does not display. What am I doing incorrectly?
Thank you!
"PO_flag." On my subform, I have a field called "PO_no". If the PO_flag
field is checked (=True) the PO_no field on the subform must be required
(filled in). If not, the message will be MsgBox "You must enter a PO#." I
put the following code (thank you, Allen Browne) in the BeforeUpdate event of
the subform, not in the property section of the PO_no field (in subform):
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.Parent!PO_flag.Value Then
If IsNull(Me.PO_no) Then
Cancel=True
MsgBox "PO# required."
End If
End If
End Sub
When I check the box for PO_flag, and the PO_no in the subform line items
are blank, the MsgBox message does not display. What am I doing incorrectly?
Thank you!