The Data has Been Changed

D

Design by Sue

My database includes forms to allow the user to correct entries, for example,
if the user misspelled a company name, he would select the incorrect name
from the list and enter the correct name in the "change to box" and click the
"modify button" to correct it.

In this example, the company names are stored in the CompanyNameTbl. This
CompanyNameTbl has a one to many relationship with the CompanyPartTbl. The
coding for the modify button is an update SQL statement that changes the
names in the CompanyNameTbl, and therefore the CompanyPartTbl is also updated.

I have the database split into application and data files.

My problem is when I modify the first record (and this is only a problem
with modifying the first record, it doesn't happen on any of the others) the
modification takes place, but then when I go to select another record for
modification I get the error message "The data has been changed. Anothe ruser
edited this record and saved the changes before you attempted to save your
changes. Re-edit the record.).

If I recombine the database so the tables are with the application, I don't
get the message.

Please if you can - Help - I have to deliver this project tomorrow morning.

(I have found that if I program a DoCmd.Close and DoCmd.OpenForm to close
and reopen the edit form the problem is gone which though bad! could get me
out of the problem for the short term but that is a bad way to go!)

help! please. Thanks

Sue
 
M

Maurice

Sue,

My guess is that when you make the change the form is still Dirty. So before
you run the updatequery set the formstate to dirty=false.

I don't know how you trigger the query but if you have a button to run the
updatequery set me.dirty=false above the line where you execute the query.

hth
 
D

Design by Sue

Thank you for taking the time to respond. I just figured out my problem - I
had a record source on the form - that was the "other user" but should I
have the problem again, I will remember your suggestion.

Sue
 

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