G
Guest
Hello everyone,
I know this question has probably been asked before, but I just can't seem
to get it right. How do I code a single command button with two entirely
different events. I'm using Access 2002. I don't know if this is the
correct process or not but here are the two different events I would like the
one command button to call:
Private Sub Command596_Click()
On Error GoTo Err_Command596_Click
DoCmd.GoToRecord , , acNewRec
Exit_Command596_Click:
Exit Sub
Err_Command596_Click:
MsgBox Err.Description
Resume Exit_Command596_Click
End Sub
_________________________________________________________________
Private Sub NEWSNAPSHOT_Click()
SNAPSHOT2 = Nz(DMax("SNAPSHOT2", "SNAPSHOT"), 0) + 1
End Sub
As you can probably tell, right now I have two different command buttons.
Just for my own purposes, I would like to combine these two separate events
and command buttons into one command button with two different events. Your
help is greatly appreciated. Thank You.
I know this question has probably been asked before, but I just can't seem
to get it right. How do I code a single command button with two entirely
different events. I'm using Access 2002. I don't know if this is the
correct process or not but here are the two different events I would like the
one command button to call:
Private Sub Command596_Click()
On Error GoTo Err_Command596_Click
DoCmd.GoToRecord , , acNewRec
Exit_Command596_Click:
Exit Sub
Err_Command596_Click:
MsgBox Err.Description
Resume Exit_Command596_Click
End Sub
_________________________________________________________________
Private Sub NEWSNAPSHOT_Click()
SNAPSHOT2 = Nz(DMax("SNAPSHOT2", "SNAPSHOT"), 0) + 1
End Sub
As you can probably tell, right now I have two different command buttons.
Just for my own purposes, I would like to combine these two separate events
and command buttons into one command button with two different events. Your
help is greatly appreciated. Thank You.
have an awesome day
happy to help