Save record code

Matizo

Registered User.
Local time
Today, 09:12
Joined
Oct 12, 2006
Messages
83
Hello every1.

I am looking for code for a cmd button that will give a msg "Do you want to save changes?" with YES and NO options. If yes then the record will be saved a the form closed if No form wil be closed but no changes made to record.

Thanks is advance!
 
I use something like this:
Code:
        If MsgBox("Do you want to save the changes?", vbYesNo) = vbNo Then
            	      Me.Undo
	      Me.Close
        Else
	      ‘Whatever code currently saves the data
                   Me.Close
        End If
I'm sure there are many other ways to do it (almost certainly better than this, but it does what I need).

Hope it helps.
 
Thanks for reply!:)

Yes I will use it because I can't find the one I'm looking for.
This code works if the user made just one change but if there were few changes only the last change made is undo.

Regards,

Matt
 

Users who are viewing this thread

Back
Top Bottom