Repost: Require Data Entry

D

D Collins

Hello,

I have a main form that has a button to bring up a pop up form. I want a
warning to be triggered based on a particular field's value on the main form
that would alert the user to fill in the pop up form. But, once the pop up
form has been filled in, I don't want it to trigger the message again.

I have put code in the form's On Current event that does bring up this
message box, but my dilema is that it triggers all the time the field's value
is that certain criteria, even after I have entered data into the pop up
form. What I want is for the event not to trigger if the pop up form has
been filled in. I'm sure it's a couple of lines of code that tests if the
pop up form has been filled in, but I'm at a loss.

Thanks for your help.
DMC
 
S

Stefan Hoffmann

hi,

D said:
I have a main form that has a button to bring up a pop up form. I want a
warning to be triggered based on a particular field's value on the main form
that would alert the user to fill in the pop up form. But, once the pop up
form has been filled in, I don't want it to trigger the message again.
Where do you save the values entered in your pop-up?
I have put code in the form's On Current event that does bring up this
message box, but my dilema is that it triggers all the time the field's value
is that certain criteria, even after I have entered data into the pop up
form.
Post this piece of code.


mfG
--> stefan <--
 
O

Ofer Cohen

On the Before update event of the pop up form you can write the code

If IsNull(Me.FieldName) Then
MsgBox "FieldName must be filled"
Me.FieldName.SetFocus ' will return the cursor to the required field
Cancel = True ' wont let the form close until the field is filled
End If
 
Top