Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving records

Status
Not open for further replies.

vols77

Technical User
Feb 17, 2007
29
US
On the form, there is a button "add record" that when clicked, the new record automatically fills in the field "Job", what I am tring to do is to prevent the user from saving the record unless the field "BOL" is filled in.
I have tried several things but can not seem to figure it out.

Ideally,
If the user tries to exit the form without the field being completed a pop up box saying "BOL" not entered, if you exit, the record will not save. Do you wish to exit? Yes or No.
If the user chooses "YES" then the record will not save and the form will close, or if they pick "NO", the focus will go to the record to allow them to enter a value in the BOL field.

One thing someone told me is that I should make sure the code goes for both null and as if the user entered then backspaced the value out of the field.

Any suggestions are greatly appreciated!
 
I am lost in the translation from the posted code to what I would need to change to work....
 
A common way is to enforce the validation rules in the BeforeUodate event procedure of the form, playing with the Cancel argument and the SetFocus method.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top