Results 1 to 9 of 9
  1. #1
    New Lounger
    Join Date
    May 2004
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Access - Disabling 'Write Conflict' Dialog Box (Access 2000 SP2)

    I have binded textbox fields (Access 2000 form) to a linked SQL view. When I update a SQL field (SQL UPDATE statement in VBA), everything at that point in time is fine. At least everything appears to be alright to the end user. However, it is when a user tries to then navigate through the recordset, that the "Write Conflict" dialog box appears. I want to disable this. Setting "DoCmd.SetWarnings" to "False", behind custom navigation command buttons (first, previous, next, last) does not work. I wish it did.

    Any help here would be greatly appreciated.
    Thanks,
    Allen

  2. #2
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Schenectady, New York, USA
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access - Disabling 'Write Conflict' Dialog Box (Access 2000 SP2)

    Allen,

    Could you post the code that you have behind your navigation buttons?
    Don
    <img src=/S/flags/USA.gif border=0 alt=USA width=30 height=18> <img src=/S/flags/NewYork.gif border=0 alt=NewYork width=30 height=18> "Life on Earth is expensive, but at least it includes a free trip around the Sun."

  3. #3
    New Lounger
    Join Date
    May 2004
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access - Disabling 'Write Conflict' Dialog Box (Access 2000 SP2)

    Here is the code:

    Almost 8,000 character long piece of code moved to attachment - Mod
    Attached Files Attached Files

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Access - Disabling 'Write Conflict' Dialog Box (Access 2000 SP2)

    I don't understand the code for the "back" button - there is no instruction to move to the previous record.

    But if you use SQL in DAO or ADO to update the record, you are going behind the back of Access, as it were. When you move to another record, Access notices that the record has been tampered with by another process. Try executing the SQL using DoCmd.RunSQL instead of a DAO or ADO instruction.

  5. #5
    New Lounger
    Join Date
    May 2004
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access - Disabling 'Write Conflict' Dialog Box (Access 2000 SP2)

    I apologize for including the "Back" button code snippet. It is not a record navigation button. Please disregard this piece of code.

    Thank you for taking a look and for your explaination. I appreciate it. I tried DoCmd.RunSQL and did not have any luck. There has got to be a way to turn off the "Write Conflict" dialog box.

    Thanks,
    Allen

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Access - Disabling 'Write Conflict' Dialog Box (Access 2000 SP2)

    Suppressing the error message could be done by writing an error handler, but it is not the way to go. Instead of ignoring the symptom, you should try to find the cause, and do something about it. Perhaps someone can help if you provide more information.

  7. #7
    New Lounger
    Join Date
    May 2004
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access - Disabling 'Write Conflict' Dialog Box (Access 2000 SP2)

    Solution Found - Just before I run the DoCmd.RunSQL, which runs a SQL UPDATE statement, I added the code:

    Me.Refresh

    This code ensures that your data is written to disk. Then the UPDATE statement runs without the "Write Confict" dialog box, which makes sense since the data is stored on the SQL Server.

    Thanks for everyone's help.
    Allen

    ************************************************** ******************************************
    Code Snippet (run when checkbox is single-clicked):

    'Update "tblRequest" OWNER and OWNER_FLAG for the selected request
    strSQL1 = "UPDATE tblRequest SET dbo_tblRequest.OWNER = '" & gstrUserName & "', " & _
    "OWNER_FLAG = 1 WHERE dbo_tblRequest.REQUEST_ID = " & CInt(Me.REQUEST_ID.Value)

    'Temporarily turn off default update warnings
    DoCmd.SetWarnings False

    'Write data to disk
    Me.Refresh

    'Execute SQL statement
    DoCmd.RunSQL strSQL1

    'Reflect new data changes in form
    Me.Refresh

    'Turn on default update warnings
    DoCmd.SetWarnings True

  8. #8
    2 Star Lounger
    Join Date
    Jul 2002
    Location
    Sacramento, CA
    Posts
    193
    Thanks
    3
    Thanked 1 Time in 1 Post

    Re: Access - Disabling 'Write Conflict' Dialog Box (Access 2000 SP2)

    Hans,

    I have a similar situation in which I'm modifying data in one open form from another form. I first wrote this using DAO recordsets and encounterd the write conflict, I then modified the approach to use docmd.runsql. This worked on my machine, but when I intalled it on the coutomer's machine the write conflict reappeared. I then tried an OpenQuery approach, again worked on my machine but not on the customers's. We are both in Windows XP MCE, but he's using Office 2002 and I'm in Office 2003.

    Appreciate any thoughts/insights/advice you might have on this.
    Marty

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Access - Disabling 'Write Conflict' Dialog Box (Access 2000 SP2)

    Could you close the other form, then run the update code, and finally reopen the form again?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •