Solved

Access write conflict

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

815 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now