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

Form_BeforeUpdate event triggering when should not

Status
Not open for further replies.
Jun 9, 2004
15
GB
Hi,

I have a form associated with a recordset.
I can navigate through back and forward and make changes quite happily.
The problem occurs when I try to cancel partial entry of a NEW record.
I have my form validation code in the form_beforeupdate event to verify all the fields are populated and valid.
However, when pressing ESC to cancel the entry, it appears to cancel (My autonumber field reverts to (AutoNumber) ). My form_undo event triggers etc
The trouble is the beforeUpdate event then triggers again?
This is only on new records being cancelled.
The form me.dirty is true, although not sre why as I thought the ESC effectively reset this state.

Any ideas?

I am using 2002 format for the first time, hope it is nothing to do with that!
 
Found out reason,
I was initialising a combo box with valid values based on another combo box, changed the initialise to recongnise me.newrecord and not change value and it now does the UNDO without calling the BeforeUpdate. Suppose it was doing what it should, just took a nights sleep to come back to the problem fresh. Took me 10 minutes this morning [sunshine]

Annoying this is that the auto number still increments even though UNDOne the data entry. So I have gaps in the sequence. I usually do my own control number for records but trying to use more of accesses in built features instead of coding it all.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top