Update or Cancel Update without AddNew or Edit

G

Guest

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
 
G

Guest

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
 
G

Guest

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top