gcgcit
asked on
Syntax for reference control on subform datasheet
On the main form, there is a print button. Before printing, I need to validate the subform field is not null.
subform is called "sbfrmTransaction"
control is called "cboEmployeeCode"
Here is my code:
If IsNull(???) Then
MsgBox "Employee code must be filled in before printing."
Exit Sub
End If
1) What would the syntax be in the IsNull(???)
2) Subform is a datasheet, do I have to loop through all the records to validate each of these fields?
subform is called "sbfrmTransaction"
control is called "cboEmployeeCode"
Here is my code:
If IsNull(???) Then
MsgBox "Employee code must be filled in before printing."
Exit Sub
End If
1) What would the syntax be in the IsNull(???)
2) Subform is a datasheet, do I have to loop through all the records to validate each of these fields?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
< do I have to loop through all the records to validate each of these fields?>
If you are priniting a report, why not just create an Access report whose underlying query excludes nulls in that field (no code necessary)?
If you are priniting a report, why not just create an Access report whose underlying query excludes nulls in that field (no code necessary)?
ASKER
Worked perfectly.
If IsNull(me.sbfrmTransaction