Results 1 to 5 of 5
  1. #1
    Sune is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2011
    Posts
    3

    A save macro

    My job was thinking of using access to edit a live database. Is there any way to create a macro that works like a save button. With yes and no options?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Macro can save record, some conditional code in macro is possible, however, I only use VBA. Yes and no options for what?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Sune is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2011
    Posts
    3
    Found a VBA code Runcommand acCMDSaveRecord.

    Yes and no options for what? Poor describing from me
    Was thinking of when you run the save macro a options box with Yes and No appears.
    Yes=Save No=Cancels the macro

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Yes, that is the command to save record. A record (or edits to existing record) is committed to table when form closes, move to another record, or code runs. So in button Click event, something like:

    If MsgBox("Do you really want to save now?", vbYesNo) = vbNo Then
    Exit Sub
    Else
    DoCmd.Close acForm, Me.Name, acSaveNo
    or
    DoCmd.RunCommand acCmdSaveRecord
    End If
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Sune is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2011
    Posts
    3
    Thanks for the help

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

Similar Threads

  1. Macro to save report to PDF with custom name
    By chris.williams in forum Programming
    Replies: 2
    Last Post: 10-13-2011, 02:34 PM
  2. Create macro save report as PDF
    By bishop in forum Access
    Replies: 3
    Last Post: 09-17-2011, 11:50 AM
  3. Replies: 9
    Last Post: 01-20-2011, 02:22 PM
  4. Replies: 0
    Last Post: 01-12-2011, 12:43 PM
  5. Help Require (Macro Save button )?????
    By aligahk06 in forum Access
    Replies: 1
    Last Post: 04-18-2010, 08:38 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