Results 1 to 3 of 3

Save BeforeUpdate with audit trail code error when more than 1 person in db

  1. #1
    VicPinn is offline Novice
    Windows 10 Access 2007
    Join Date
    Feb 2019
    Posts
    2

    Save BeforeUpdate with audit trail code error when more than 1 person in db

    Hi all,



    I'm really no good with VBA code & found & amended the following code to ask to save before moving on to a new record & also make an audit of a couple of fields. It was working fine until more than one user was accessing the database at any one time:

    Private Sub Form_BeforeUpdate(Cancel As Integer)

    'Provide the user with the option to save/undo
    'changes made to the record in the form

    If MsgBox("Changes have been made to this record." _
    & vbCrLf & vbCrLf & "Do you want to save these changes?" _
    , vbYesNo, "Changes Made...") = vbYes Then
    DoCmd.Save
    Else
    DoCmd.RunCommand acCmdUndo
    End If
    If Not Me.NewRecord Then Call AuditChanges("Quote Inv No")
    End Sub

    I have amended the code just to:

    Private Sub Form_BeforeUpdate(Cancel As Integer)
    If Not Me.NewRecord Then Call AuditChanges("Quote Inv No")
    End Sub



    But I really want the user to confirm first before it saves as people keep overwriting the wrong fields by accident. Please can someone suggest changes to the code that will mean more than one person can be in the database at a time.

    Thanks for your help.

    Kind regards

    Vicky

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    7,260
    you really dont since Access saves automatically.
    The user shouldnt be editing if they didnt want to save it.

    In a multi-user environment, there should be no conflicts UNLESS you did not split the database.
    did you split the database? ( 1 backend table db, and a copy of the frontend to each user)

  3. #3
    VicPinn is offline Novice
    Windows 10 Access 2007
    Join Date
    Feb 2019
    Posts
    2
    Hi,

    I have a backend table db & the users are only viewing the data in a form view. The users keep thinking they have selected the search box at the bottom to search but haven't clicked into it correctly so it is still in a record & they are over-typing the record with the search query. As there is no undo this is quite a problem as they don't know the data they just wrote over. That is why I need it to ask to save. Any ideas?

    Thanks
    Vicky

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

Similar Threads

  1. Replies: 2
    Last Post: 08-28-2018, 09:38 AM
  2. Replies: 1
    Last Post: 09-01-2015, 01:01 PM
  3. Audit Trail Code Type Mismatch
    By sstiebinger in forum Programming
    Replies: 9
    Last Post: 04-03-2015, 07:59 AM
  4. Audit Trail Code - Error 3251
    By Juans in forum Access
    Replies: 3
    Last Post: 01-04-2015, 01:21 PM
  5. Replies: 2
    Last Post: 02-09-2013, 11:39 AM

Tags for this Thread

Posting Permissions

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