Solved

Saving Subform record Problem

Posted on 2014-01-25
3
1,395 Views
Last Modified: 2014-01-27
When leaving a subform I get write conflict. "Another user has changed the record. Save Drop or copy to clipboard".

In this subform I  set a main form field value from the subform. So it may be that the main form's record is needing saving rather than the subform's record? I can't seem to find the secret of how to do this.

I have a "Close" button on the subform that moves the focus to the main form and then sets the subform visible property to false. It is doing this that causes the error
0
Comment
Question by:DatabaseDek
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 39808584
Most times that is caused by using VBA/SQL to modify the same record as you're viewing on the form or subform. I wouldn't imagine the main form record is dirty (it's saved when you move off the main form to the subform), but try saving your main form record:

Me.Parent.Dirty = False

Do this before the subform exit.

Also, if you're using VBA to work with the form (or subform) data you'll have to change that and make the data mods directly on the form. For example, instead of doing this:

Currentdb.Execute "UPDATE MyTable SET MyField=True WHERE RecordID=" & Me.RecordID

You'd just do:

Me.MyField = True

And let Access handle the saves.
0
 
LVL 48

Expert Comment

by:Dale Fye (Access MVP)
ID: 39808871
No points, please!

Scott, I think that is exactly the problem.  The OP indicated that code in the sub form is modifying a value on the main form
0
 

Author Closing Comment

by:DatabaseDek
ID: 39811413
Thank you. Most helpful
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question