Results 1 to 2 of 2
  1. #1
    LAazsx is offline Advanced Beginner
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Nov 2010
    Posts
    30

    Saving records when a button is pushed

    Hi, I don't really have experience with Access's macro so I don't really now what i need to do. I want to able to save records to tables only after when a "Save" button has been pressed.



    I've been tinkering around with Access 2010's macro builder and added the SaveRecord line, but I think that this is useless since, the form will still save the record even if the button was not pressed.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    If you *must* have a "Save" button then create a Public Boolean Variable at the top of the Code Module before any procedures. Then Set it True behind your "Save" button and Save the record as well (use the CommandButton wizard to create the "Save" button). In The BeforeUpdate event of the FORM Put the following code:
    If Not BooleanVariable Then
    Me.UnDo
    End If
    ...using your name for the BooleanVariable of course.

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

Similar Threads

  1. saving records without null or empty fields
    By amber mara in forum Access
    Replies: 1
    Last Post: 05-05-2010, 02:34 PM
  2. VB coding for saving when click on save button in form
    By cwwaicw311 in forum Programming
    Replies: 1
    Last Post: 02-04-2010, 11:11 PM
  3. programming button to update records
    By lstairs in forum Programming
    Replies: 5
    Last Post: 02-04-2010, 08:07 AM
  4. Button on form to delete all records
    By bbylls in forum Forms
    Replies: 2
    Last Post: 12-08-2009, 12:38 PM
  5. Saving records in multiple sub forms
    By niak32 in forum Forms
    Replies: 0
    Last Post: 10-13-2008, 04:24 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