Checking data in subform

laurat

Registered User.
Local time
Today, 22:46
Joined
Mar 21, 2002
Messages
120
In my form there is data entered, there is also a subform where data is entered. Is there a way for me to check the subform (it is in datasheet view) when the main form is closed to see if the required fields contain data. I have code that checks the fields on the main form but I am having trouble with the subform. Thank you.
 
You'll need to refer to your fields on the subform differently than on the main form. The syntax is;

Forms!NameOfMainForm!NameOfSubform!Forms.NameOfFieldOnSubform
 
You'll have to toggle a Boolean field and check it's status before allowing the form to close by using the UnloadEvent of the Parent form
 
So could I put

If IsNull(Forms!NameOfMainForm!NameOfSubform!Forms.NameOfFieldOnSubform) Then.....

For some reason it is not working for me like the same code for the main form (code is in Unload event of main form)
 

Users who are viewing this thread

Back
Top Bottom