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?
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?
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.
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
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.
Thanks for the help