Update or Cancel Update without AddNew or Edit

S

swedbera

Hello,

I'm getting this error on my form when the user changes a record and before
moving to another control, clicks on a combobox used to filter the records.

Error number -2147352567 Cancel Update without AddNew or Edit

Can someone tell me what I can do to fix this?

Arlene
 
A

Allen Browne

The error is not very clear, but it means the current record is dirty so
Access must save it before you move to the other record.

You can avoid the error by explicitly saving the record before you try to
move. Try adding this line to the top of your event procedure:
If Me.Dirty Then Me.Dirty = False
 
S

swedbera

Problem solved. Many thanks!

Arlene

Allen Browne said:
The error is not very clear, but it means the current record is dirty so
Access must save it before you move to the other record.

You can avoid the error by explicitly saving the record before you try to
move. Try adding this line to the top of your event procedure:
If Me.Dirty Then Me.Dirty = False
 
D

david101

Thanks For the answer to a very vexing problem!!

I would like to add that I placed the code inside the combobox's Change()
event.

It worked like a charm!
 
Top