Write conflict

I have a form and on the form I have a command button which when clicked makes a 2nd form pop up.  Both forms are bound to the same record source.  But after the user enters information in the 2nd form and then closes it all is fine until he tries to close the main form.  He gets a Write Conflict popup.  (See attached).

Why is this happening?


Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dale FyeOwner, Developing Solutions LLCCommented:
chances are that you made changes in the main form, then made subsequent changes in the 2nd form.

When you saved the changes in the 2nd form, you need to update those fields in the main form as well, or you will get this conflict.  If you are not actually displaying those fields in the main form, you should remove them from the query that is the record source for the main form.
Rey Obrero (Capricorn1)Commented:
you can try this, in the click event of the button that opens the second form

private sub btn_click()
if me.dirty then me.dirty=false     'save the edited or new record

docmd.openform "yoursecondformname"

end sub
SteveL13Author Commented:
Actually I made change.  I removed the command button which opened the 2nd form and put the text box that was on the second form onto the 1st form.  But now when the user makes an entry in that text box it indicates that it was "#Deleted" and then a message pops up saying "Record is deleted".

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
What's the reason for having a popup based on the same recordsource? In most cases, you're much better off including all needed fields on the main form.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.