Results 1 to 10 of 10
  1. #1
    Wappervliegje is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jan 2017
    Posts
    5

    Write Conflict By Checkbox In Continuous Form

    Dear people,



    I get always an error "Write Conflict" after using a checkbox in a continuous subform. This subform have a query as a rowsource. I don't know how to dissolve this error? I've done everything I can do. See below the code of the current checkbox.

    P.S. I'm working with Microsoft Access 2007

    Code:
    Private Sub chk_LAIPs_Final_AfterUpdate()
        With Me
            If .chk_LAIPs_Final = True Then
                With DoCmd
                    .SetWarnings False
                    .RunSQL "UPDATE tbl_def_Patients_LAIPs SET [LAIPs_Final] = False WHERE [Auto_Number]=" & Me.Parent.[Auto_Number] & ";"
                    .SetWarnings True
                    .RunCommand acCmdSaveRecord
                End With
                .[%_PM_CF] = ""
                .[Final_%_CF] = ""
                .[%_PM_MRD] = ""
                .[Final_%_MRD] = ""
                .Refresh
            Else
                With DoCmd
                    .RunCommand acCmdSaveRecord
                End With
                .[%_PM_CF] = ""
                .[Final_%_CF] = ""
                .[%_PM_MRD] = ""
                .[Final_%_MRD] = ""
                .Refresh
            End If
        End With
    End Sub

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    If the form is bound, you've dirtied the record by checking the box, and the tried to update it in code. You can try saving the record before running the SQL.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,511
    Put a breakpoint at the beginning and step through the code to see which line it is giving the error, on the Update line or the Save Record line? Is Autonumber text or numeric?

  4. #4
    Wappervliegje is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jan 2017
    Posts
    5
    Dear pbaldy and Bulzie,


    Thank you for your reaction and advices. I noticed that this write conflict always comes back when I jump direct from checkbox to checkbox in the other record and the other way around in a continuous form. This write conflict is not present if I go from textbox to textbox in other record in the same continuous form. It does not matter if there is a VBA rule or not. Do you maybe know this problem?


    With kindly regards,


    Dennis.

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Did you try any of the suggestions? This error typically happens when you have both a bound form and code updating records. Forcing a save before updating in code can avoid it.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,511
    Can you explain again your process for the record, checking the box and then what do you expect to happen? So is your continuous form fields all bound to fields in the query or some are but the check boxes are not? Explain what it is you are trying to do, do you display all the other fields form the query but you have a check box and if checked you want to update that same record?

  7. #7
    Wappervliegje is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jan 2017
    Posts
    5
    Dear Bulzie,

    I've made a short record of my Access database and you can see what I'm doing with this database. I thought it might be transparent what I meant with my problem?

    But my Access database is set to Dutch.

    Standaardwaarde = Standard Value
    Schrijfconflict = Write Conflict

    https://youtu.be/NCWkrOGkYiE

  8. #8
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,511
    In your code, put a breakpoint at the top(click in grey to left), click the box and then use F8 to step through the lines to see which one it errors on.

    So your records come from the query but each line has an unbound checkbox and when clicked, you want to run an update code to change a value and then save the record and blank out the other fields?

  9. #9
    Wappervliegje is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jan 2017
    Posts
    5
    Dear Bulzie,

    Thank you for your advice on using breakpoint. The writing error is not caused by my current VBA-procedure (see above), but by the VBA-procedure in a subform in this current subform. And that blows with each other. I learned a lot about using this breakpoint. Thank you for your effort to think with me and also for your advice. I'm very happy now.

    With kindly regards,

    Dennis.

  10. #10
    Wappervliegje is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jan 2017
    Posts
    5
    Dear people,

    I was completely forgotten to mention here too that I have put my current question on another forum. See the link below. I think that is nice and also on someone's advice on that forum.

    http://www.utteraccess.com/forum/ind...&#entry2664527

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

Similar Threads

  1. Write Conflict.
    By Homegrownandy in forum Forms
    Replies: 5
    Last Post: 05-18-2017, 05:29 PM
  2. Form write conflict
    By loop123 in forum Forms
    Replies: 4
    Last Post: 02-05-2017, 11:28 AM
  3. sub form write conflict error
    By Slush in forum Forms
    Replies: 4
    Last Post: 09-23-2016, 02:02 PM
  4. Replies: 21
    Last Post: 09-16-2016, 08:44 PM
  5. Replies: 3
    Last Post: 08-06-2012, 03:29 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