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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

stop form closing if record not validated

Status
Not open for further replies.

nuct

Programmer
Sep 5, 2001
103
Hi,

I have a form which has code in the beforeupdate event which is used to validate records. It all works fine except that I would like to make it so that when the user clicks the close button and the record does not meet the validation rules the form stays open so they can make the necessary changes or cancel them.

The problem is that when the form closes it calls the beforeupdate event, this then puts up a message asking if they want to make the neccessary changes, it they click yes I would like the form to stay open. However Im not sure how I go about cancelling the closure of a form.

Any ideas.

Simon.

 
I posted some form code here thread702-866344, that I think should meet your requirements. There are also some other discussion there that might be relevant.

Roy-Vidar
 
cheers for that, I found the solution there.

Simon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top