Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228

    Write Conflict.

    I've resolved this issue before, but I forget how!



    The problem is, when I press a button on the form it runs some update querys, If the form has had some input then this creates a conflict.

    I thought
    Code:
    docmd.save
    before the code would save the updated fields before running the query, but in this case that doesn't seem to help.

    I know that is how to resolve it. It needs to be saved prior to the update query running. But This line isn't achieving that.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    if you want to Save data entered in a form, then you dont really need a command. When the user leaves the record (or form), its automatically saved.
    that command is not needed.

  3. #3
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    I need it force it to happen before leaving the form as the form is referenced in the update query. I know its something simple.. one line of code... I cant seem to find it.

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    DoCmd.Save is saving the open object, i.e. the form. To save the data use DoCmd.RunCommand acCmdSaveRecord

  5. #5
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    Perfect. Makes sense.

  6. #6
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Or look at the "Dirty" property.

    I use
    Code:
    If Me.Dirty Then
       Me.Dirty = FALSE
    End If
    I think (could be wrong) you can also use just
    Code:
    Me.Dirty = FALSE

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

Similar Threads

  1. Write Conflict
    By RayMilhon in forum Forms
    Replies: 16
    Last Post: 12-12-2014, 10:31 AM
  2. Write Conflict?
    By batowl in forum Forms
    Replies: 4
    Last Post: 11-13-2014, 12:38 PM
  3. Write Conflict Help
    By jbailey4545 in forum Access
    Replies: 5
    Last Post: 01-24-2014, 02:25 PM
  4. Write conflict
    By IslandHydro in forum Programming
    Replies: 4
    Last Post: 10-25-2013, 09:30 AM
  5. Write Conflict
    By sah in forum Forms
    Replies: 8
    Last Post: 04-25-2012, 07:19 AM

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