Run VB and Macro Event in BeforeUpdate

Zaxxon

Registered User.
Local time
Today, 17:24
Joined
Aug 5, 2008
Messages
22
Hi I have two things I want to run in my BeforeUpdate of a form. First, I want to have a TimeStamp macro to run. Second, I want an Event Procedure that asks the user whether or not they want to save. I can't seem to have both. I select one in the property sheet under Before Update the other one doesn't run.

Is there a way to have both these running for a form?

I made the TimeStamp macro according to the Help in Access and my Save event looks like this:
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
    Resp = MsgBox("Do you wish to save the new/edited data?", vbYesNo + vbQuestion, "Unsaved Data")
    If Resp = vbNo Then
       Me.Undo
    End If
End Sub

Thanks
 
Do both from the event procedure:

Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
    Resp = MsgBox("Do you wish to save the new/edited data?", vbYesNo + vbQuestion, "Unsaved Data")
    If Resp = vbNo Then
       Me.Undo
    Else
       DoCmd.RunMacro "YourTimeStampMacroNameGoesHere"  
    End If
End Sub
 
Excellent that's what I was looking for, thanks!
 

Users who are viewing this thread

Back
Top Bottom