Solved

Access write conflict

Posted on 2011-02-18
3
497 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
[X]
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
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

691 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