Solved

Access write conflict

Posted on 2011-02-18
3
491 Views
Last Modified: 2012-05-11
Hi Experts.

I have an Access app wich have a huge form, separated in different tabs, many of who have inside subforms that bring data related from several tables.

Users often have to copy data from several fields in different tables in a record to another record. To lighten this manual process, I've added a button that automates the copy of that data from one record to another using SQL queries.

Well... here comes the problem. After executing the code of the button, the next time that the user changes to another page of the tab, or when he tries to close the form (I launch saving record code on both events) he receive an alert message with a write conflict, offering them to save the data, copy to clipboard or don't save.

It's irrelevant the button that users select, as data is correctly saved into the current record. It only seems to detect the conflict (probably between the save made from the queries and the following save made when switching tabs) and throws the annoying alert window.

I've googled a bit looking for a solution to this, I've also tried to force a  "DoCmd.RunCommand acCmdSaveRecord" just after finishing button's proccess and tried to silence the warning through DoCmd.SetWarnings False to no success.

Any ideas? I'm seeking how to correct the conflict, but as data is being correctly recorded, I'll be happy enough if the alert is silenced.
0
Comment
Question by:Bardobrave
  • 2
3 Comments
 
LVL 14

Expert Comment

by:Bill Ross
ID: 34925209
Hi,

If you are running an append query or code behind the button can you please post the code?

I supect what is happening is that the datya in the database and the data on the screen are out of sync.

Rather than trying to save the form data you should refresh it to get the revised data from the table.

replace
DoCmd.RunCommand acCmdSaveRecord
with
me.refresh

That should do it - but post your code anyway.

Regards,

Bill
0
 
LVL 19

Accepted Solution

by:
Bardobrave earned 0 total points
ID: 34925356
I've found the solution myself.

In the whole button's proccess I was setting values directly in one of the subforms, launching a saverecord, and after that saving them again through a query (O_o¿) after commenting the query the alert dissapears and data still is correctly saved.

Thanks anyway.
0
 
LVL 19

Author Closing Comment

by:Bardobrave
ID: 34959005
Solution was related to a code error that I've finally found by myself
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying 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

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
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 …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

839 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