Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to save before exiting

Status
Not open for further replies.

rbeatty

MIS
Oct 28, 2002
8
US
Is there a way to make the database prompt to save when exiting. I am having a problem with people making changes on accident and then exiting and thus it saves automatically.
 
Would'nt it be easier to lock each record when it is completed and then force users to click on a button which would then allows them to edit the record

Hope this helps
Hymn
 
Add the following to the On Click event of the exit button

If MsgBox("Would you like to save changes made to this record?",vbyesno,"SAVE CHANGES") = vbYes Then
DoCmd.RunCommand acCmdSaveRecord
Else
MsgBox "Changes have not been saved."
me.undo
End if

DoCmd.Close




"I know what you're t'inkin', ma petite. Dat Gambit... still de suave one, no?"
 
or you can easily without using code to make a macro attached to the exit button. On the macro, line 1, have "Save"...the critearia at teh bottom allows you to choose "Prompt", "Yes" or "No"



"There are two ways to write error free programs. Only the third one works."

Cmoorejr.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top