Solved

Access write conflict

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

747 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

11 Experts available now in Live!

Get 1:1 Help Now