Anomalies when Canceling a Record Update (1 Viewer)

whdyck

Registered User.
Local time
Today, 06:08
Joined
Aug 8, 2011
Messages
169
I'm using Access 2003.

I have a simple form that is exhibiting behavior that seems very bizarre. I've attached the mdb.

Here's how to see what I mean:

1. Open frmEmployee
2. In the Vehicle combobox, select the first entry (2005 Pontiac Montana). Note that for this vehicle, Inactive = No.
3. Save the record.
4. Now in the Vehicle combobox, use the mouse to select the 2009 Honda Civic, noting that it is flagged as Inactive = Yes. Note the error message that appears. Click OK.
5. Cancel the record changes by pressing [Esc]. Note that the Vehicle cbo reverts to the value previously saved (2005 Pontiac Montana).
6. Select the text in the Vehicle cbo and delete it, then press Tab. Note that it still thinks that the Vehicle cbo contains "2009 Honda Civic", which is inactive. Click OK, then [Esc].
7. Now click tha record selector.
8. Select the text in the Vehicle cbo and delete it, then press Tab, then save the record.

Question #1: Why do we get the error message in step #6, but not in step #8?

Now try repeating the same steps above, except that in step #4, select the 2009 Honda Civic from the keyboard instead (just typing "2009" should get you to that entry). Note that, in this case, it saves without error in step #6.

Question #2: Why the difference?

Question #3: How do I get the "mouse version" to work as I'd expect?

Thanks for any help you can give.

Wayne
 

Attachments

  • TestInactive.zip
    191.3 KB · Views: 47

JHB

Have been here a while
Local time
Today, 13:08
Joined
Jun 17, 2012
Messages
7,732
Try by putting in a Me.ControlName.Undo in your code.
 

Mihail

Registered User.
Local time
Today, 14:08
Joined
Jan 22, 2011
Messages
2,373
... or just Me.Undo
 

whdyck

Registered User.
Local time
Today, 06:08
Joined
Aug 8, 2011
Messages
169
Try by putting in a Me.ControlName.Undo in your code.
... or just Me.Undo

I had tried both of these before my original post. Just to be sure, I tried again, but no joy.

I have concluded that this is an Access 2003 bug. I've moved the validation to the Form_BeforeUpdate event handler.

Thanks.

Wayne
 

Users who are viewing this thread

Top Bottom