Hi all
I have a form with about 20 odd fields that all need to be filled in, once complete I want a button to be pressed to generate a report, if any filed are blank I want a message box to pop up, I have used the below code but is there an easier code to use for multiple fields or do I need to do this for each?
Example Names:
Field1
Field2
Field3
I have a form with about 20 odd fields that all need to be filled in, once complete I want a button to be pressed to generate a report, if any filed are blank I want a message box to pop up, I have used the below code but is there an easier code to use for multiple fields or do I need to do this for each?
Example Names:
Field1
Field2
Field3
Code:
If IsNull(Me.Field1) Or Me.Field1 = "" Then
MsgBox "All Fields Must Be Completed", vbOKOnly
OK = True
Me.Field1.SetFocus