Results 1 to 15 of 15
  1. #1
    elbartje is offline Novice
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2017
    Posts
    23

    Access write conflict

    Hello all

    I got a write conflict, I understand why but I dont know how to go around the problem.
    I made a small version of my database so you can see the problem: download link

    The problem:

    I got 1 table and 2 forms: table1 consist of column: ID, Task, result, result1, result2

    The scenario
    Form1 is a continuous form it shows all records (ID, Task and result from table1) in a textbox.
    I have a GotFocusevent on the textbox which opens form2 and this form shows result1 and result2 of that specific record from table1.
    In form2 I can change the value of result1 and result2 when I press a button form2 closes and writes “OK” or “NOT OK” in textbox result from form1.



    Now when I immediately click in form1 on an other record I get the write error.
    Becaus I changed values of 1 record in form1 and form2.
    If I make a second table that contains result1 and result2 that should fix the problem but I prefer to keep all data in 1 table.

    I tried "Me.dirty = false",
    closing/opening or requiring is not an option because then the recent input would be filtered out (not in this test version I uploaded here).

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Cannot go to that link. Please attach database to your post.

  3. #3
    elbartje is offline Novice
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2017
    Posts
    23
    Quote Originally Posted by aytee111 View Post
    Cannot go to that link. Please attach database to your post.
    I can't attach it because the file size is to big.
    I uploaded it on another site hope this works ? : http://www.filedropper.com/writeerror

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Sorry, no links at all.

    Create a new database, delete all data except a sample that will show us the issue, compact/repair, zip.

  5. #5
    elbartje is offline Novice
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2017
    Posts
    23
    I attached a file ->
    It's a zip file but I changed the extension to .txt because I was not allowed to upload a zip for some reason.
    I hope this works.
    Attached Files Attached Files

  6. #6
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Didn't work. Try making the database small enough to attach without having to zip it.

  7. #7
    elbartje is offline Novice
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2017
    Posts
    23
    Here it is:
    Write error.accdb

  8. #8
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Success! Now to get on with your issue.

  9. #9
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    I changed the code to put the form1 changes before form2. Altho I am not sure of the logic, the changes here aren't dependent on form2 changes so why not have them on the same form?

    Code:
        If Forms("form1").Resultaat.Value = "OK" Then
            Forms("form1").Resultaat.Value = "NOT OK"
        Else
            Forms("form1").Resultaat.Value = "OK"
        End If
        DoCmd.RunCommand acCmdSaveRecord
        DoCmd.OpenForm FormName:="form2", View:=acNormal, DataMode:=acFormPropertySettings, WindowMode:=acWindowNormal

  10. #10
    elbartje is offline Novice
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2017
    Posts
    23
    I just realised I made a mistake, the evaluation of OK/NOK has to be done after I press OK in form2.
    I upload the new file.

    In the orignal database form2 has 15 fields, if I would show it in form1 it won't fit on the form.

    Allready big thanks with you help!
    Attached Files Attached Files

  11. #11
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Add the field Resultaat to form2, make it hidden.

    Code:
    If Me.Resultaat.Value = "OK" Then
        Me.Resultaat.Value = "NOT OK"
    Else
        Me.Resultaat.Value = "OK"
    End If
    DoCmd.RunCommand acCmdSaveRecord
    Forms!Form1.Requery
    DoCmd.Close acForm, "form2", acSavePrompt

  12. #12
    elbartje is offline Novice
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2017
    Posts
    23
    I did like you said but I cant make it work:
    Attached Files Attached Files

  13. #13
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    You didn't copy the code as posted.

  14. #14
    elbartje is offline Novice
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2017
    Posts
    23
    Wow sorry, I think it's getting to late.
    Yes this does what I want!
    Tomorrow I will try to integrate it in my 'original database' this should work.

    Thank you very mutch for all the help!

  15. #15
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    You're welcome!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Write conflict error in access
    By Milad Roohi in forum Access
    Replies: 5
    Last Post: 05-27-2016, 08:30 PM
  2. Write Conflict
    By RayMilhon in forum Forms
    Replies: 16
    Last Post: 12-12-2014, 10:31 AM
  3. Write Conflict Help
    By jbailey4545 in forum Access
    Replies: 5
    Last Post: 01-24-2014, 02:25 PM
  4. Write conflict - Access 2003
    By mafrank101 in forum Access
    Replies: 7
    Last Post: 10-10-2012, 07:44 PM
  5. Write Conflict Errors with SQL-Access DB
    By trb5016 in forum Access
    Replies: 5
    Last Post: 01-14-2010, 02:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums