Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 17th, 2004, 01:44 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default Write Conflict message with SQL Server tables

Hi,

   I have a simple form based on a table that is linked to a SQL server back end.

   The form is to a junction table where users are assigned assets. I use a look up combo box to select a serial number, then I use the tables combo boxes to change the user name etc. I have a button to close and reopen the same form to make sure the update has gone through.

   This has been working fine for a few months, but now, most times when I click the update button (close, reopen) I get a Write Conflict dialog box that states that the record has been changed by another user since I opened it. I know no other user is connected to the database. Normally there is an option to Save Record, but it is greyed out.

   Any help on this?

Thanks,


mmcdonal
__________________
mmcdonal

Look it up at: http://wrox.books24x7.com
 
Old November 17th, 2004, 02:47 PM
Registered User
 
Join Date: Nov 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi!
1.
If you have trigger or procedure to update table it can be cause of Write Conflict Msg.
2.Some times this code helps.
Private Sub cmdSave_Click()
On Error GoTo Err_cmdSave_Click
        DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
bfurman

 
Old November 18th, 2004, 09:45 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

I am not sure where that code should go. This is the code from the Button's On Click event:

Private Sub btnUpdate_Click()
On Error GoTo Err_btnUpdate_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "frmDetails"
    DoCmd.Close
    DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_btnUpdate_Click:
    Exit Sub

Err_btnUpdate_Click:
    MsgBox Err.Description
    Resume Exit_btnUpdate_Click

End Sub

   It is pretty crude. It just opens the form and closes it.

   If I don't click this button and just go to a new serial number, I get the same message. It is when I try to move off the record in any way that this happens. It didn't used to happen. It just started.


mmcdonal
 
Old November 18th, 2004, 11:05 AM
Registered User
 
Join Date: Nov 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Check for trigger or procedure to update any field in table you make last time.
For what do you need to close and open form, isn’t it simpler just refresh form after updating field. (me.refresh)

The code should go before this line: DoCmd.Close

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.Close





Similar Threads
Thread Thread Starter Forum Replies Last Post
Conflict in SQL Server 2000 and SQL Server 2005 ayan.mukherjee SQL Language 0 June 30th, 2008 03:34 AM
write conflict iacon VB Databases Basics 1 July 3rd, 2006 03:36 PM
Write Nested XML document into SQL Server tables boondocksaint20 VB.NET 0 May 2nd, 2006 12:35 PM
Write Conflict message mmcdonal SQL Server 2000 1 November 17th, 2004 11:39 AM
Write Conflict in continuous Form pinkandthebrain Access 2 July 18th, 2003 11:16 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.