Referencing a control on a subform

swee

Registered User.
Local time
Today, 08:26
Joined
Aug 11, 2004
Messages
66
I'm trying to check if a control on the subform is null. I've the following line of code:

Private Sub Form_BeforeUpdate(Cancel As Integer)
If IsNull(Form!FrmOrderInfoMain!SubFrmOrderInfo.ItemCode) Then
Msgbox "Empty ItemCode"
End If
End Sub

..whereby FrmOrderInfoMain is the parent form and SubFrmOrderInfo is the subform. I get an error for this code as Im not sure what is the correct code to use. Thanks for the help.


Swee
 
I think i get what u mean Pat. That was an error on my part. I meant to put the code in the BeforeUpdate event of the subform itself. Thanks for the advice.
 

Users who are viewing this thread

Back
Top Bottom