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

Cancel an on exit event 1

Status
Not open for further replies.

ZOR

Technical User
Jan 30, 2002
2,963
GB
If a textbox memo field has an on exit event, and whilst a user is typing in data during creating a new record, how can you kill the on exit event if they hit an abort/cancel record button? Thanks
 
You may test the Me.NewRecord property.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi PHV, trust your well. Clicking a button to abort the record causes the on exit event of the textbox to happen. At this point of time the record is new when trying to abort. Also the user may be wanting the on exit function to work during a new record completion as he is eventually going to save the record. Sorry if I sound confused. I looked up the NewRecord property and it said it was used to enable or disable a control when a record is new. Best regards
 
The help file should have told you that the NewRecord property is boolean, 'True' meaning that the current record is new and unsaved.

 
Thanks Joe, but I am trying to understand where that will fit in. There are two conditions of the on exit event being used. The first is normal use where the user types in some data into the text box and when he leaves the control to go to another, the textbox the on exit event does something. The second is the user does the same, but leaves the control by clicking a command button. The on exit event fires on the textbox but I don't want it to carry out the event. Therefore I cannot figure out where I can intercept the operation. Maybe I am not running on all cylinders today or explaining it very well, regards
 
Sorry, but I think your Exit event is fired before the Click event of the button ...

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks PHV, yes you are correct. I have now moved the event in what was in the on exit to a save or not save button. I had a similar problem which was in a date field, if the user went to cancel the record, a dialogue box appeared saying the data entered was incorrect or words to that, so when the user is in that field the cancel button gets disabled until the user types in all the digits. Anyhow thanks all for the help. PHV I owed you a star from earlier, thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top