Solved

Access write conflict

Posted on 2011-02-18
3
493 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

733 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