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
Solved

Saving Subform record Problem

Posted on 2014-01-25
3
1,362 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
3 Comments
 
LVL 84

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 47

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

828 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