write conflict on access form

linbayzak
linbayzak used Ask the Experts™
on
Hi Experts,

I just got an awesome solution from you guys but now i have another error.  You helped me make sure a record could be edited and not bring up another new record each time the form is accessed by changing the property on the form to Data Entry = No.  But now, i'm getting this message "This record has been changed by another user since you started editing it. If you save the record, you will overwrite the changes the other user made......"  Any idea what's going on? thanks
Laura :-)
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
You can get the write conflict message: "This record has changed by another user since you started editing it. ..." a form tries to change a record in two different ways, two forms (or a form/subform) tries to change the some record or a bound form with a multitable record source is making the change.    Some examples of the way a form can change a record is: bound form, action query, recordset.  Access, like all of MS  products, is a combination of different pieces of software grouped together so it does not recognize that a bound form changing data is the same user as an action query executed in the code of the form.

There are several different approaches to avoiding this error.  One cf the easiest is adding the line:
Me.Dirty = False
to save the record first before moving to another form or subform, running the action query or recordset or just before the message occurs.

To help figure out where the problem is occurring, click on the save to clipboard option. Open Word and paste in there to see what info caused the problem.

References:
http://support.microsoft.com/kb/837937
http://support.microsoft.com/kb/304181

Author

Commented:
where do you put the me.dirty = false

in the form unload, or in my case with a large form and tab control, should i put this in the tabctl change event, or the form unload, just not sure.  sorry....i'm a pretty inexperienced programmer, especially to be given the nature of this project.

thanks
laura
where do you put the me.dirty = false

Just before the code that is creating the problem. If the error message gives you the save changes to clipboard option, use that, paste into Word or Notepad and post that. We can figure out where to put the Me.Dirty = False together.

BTW: Me.Dirty = False saves the changed data.
Success in ‘20 With a Profitable Pricing Strategy

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
ok, all it did was give me all the field on the infant data form, so does this mean the error is occurring when the frmInfantDeliveryData is loading? thanks

Author

Commented:
Thanks a bunch, this worked, i put it in the load event of the form that returned the fields from the paste and it worked.  Hey, do you think i should put that line of code in the form load of the other forms?  they aren't erroring out right now. thanks :-)

Laura
<do you think i should put that line of code in the form load of the other forms? they aren't erroring out right now. thanks :-)>
No, only if they act up. Note: Pasting in this code doesn't help but will make you feel a little better:
Debug.Print "You've been a bad, bad form!"

YOU'RE WELCOME.  GLAD TO HELP AND THANK YOU VERY MUCH FOR THE POINTS WITH "A" GRADE!

HAPPY COMPUTING!

NELSON

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial