Results 1 to 5 of 5
  1. #1
    srmezick is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2011
    Posts
    15

    Save Error


    I added a code to one my database forms that prompts users to confirm they wish to save thier changes. However, after adding the code we are now receiving a message that prevents us from saving the changes if another user has an object open that is also connected to a table that is affected by the changes. Is there a way to fix that issue? ( The next time I see the message will update with exactly what the message says.)

  2. #2
    Toyman is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    233
    Quote Originally Posted by srmezick View Post
    I added a code to one my database forms that prompts users to confirm they wish to save thier changes. However, after adding the code we are now receiving a message that prevents us from saving the changes if another user has an object open that is also connected to a table that is affected by the changes. Is there a way to fix that issue? ( The next time I see the message will update with exactly what the message says.)
    Post the code you are using to save the record. I am assuming that this is an unbound form?

  3. #3
    srmezick is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2011
    Posts
    15
    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
    End Sub



    I dont know the difference in bound and unbound forms lol <.<

  4. #4
    Toyman is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    233
    Quote Originally Posted by srmezick View Post
    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
    End Sub



    I dont know the difference in bound and unbound forms lol <.<
    The undo command is not available in the before update event. Put the code in the after update event. The "undo" will undo the saving of the record.

  5. #5
    srmezick is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2011
    Posts
    15
    Thanks so much. Hopefully I wont have any more problems from that aspect of the database. Im having enough trouble with some of the other things Ive got going on for people to not be able to save information on top of it. =) Ill be back with more questions for sure. Maybe one day Ill be able to provide some answers lol.

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

Similar Threads

  1. Replies: 8
    Last Post: 05-12-2011, 06:11 PM
  2. Save button say syntax error
    By venu_resoju in forum Forms
    Replies: 6
    Last Post: 02-14-2011, 02:52 AM
  3. Access Form- Save/Close Button error
    By Ashe in forum Forms
    Replies: 3
    Last Post: 02-10-2011, 01:01 PM
  4. Replies: 8
    Last Post: 01-10-2011, 08:36 PM
  5. Replies: 3
    Last Post: 03-30-2010, 08:48 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