Prevent main form from closing when field not updated in subform

bgotis

Registered User.
Local time
Today, 18:44
Joined
Feb 7, 2001
Messages
12
In my subform, I want to required entry in the END_DATE field if the field Status ="Complete"

So far the code will continue to take the user back to the END_DATE field and prompt for a date as long as the Status is complete --- *except* if the user just closes the form. They'll get the error message three or four times, but eventually can close the form without entering the required information.

How do I keep the main form from closing when the required data is not entered on the subform?

Thanks in advance.
 
have a boolean called required

if "Me.requiredfield.text" = "" then
required = true
End if

on the click event of button to close the form put the following code in

If required = true then
msgBox("required field is empty")
Else
'code to close the button
End if




[This message has been edited by Anauz (edited 02-22-2001).]
 
In what part of the class module do I name the boolean?
 

Users who are viewing this thread

Back
Top Bottom