RichieP
Rock on!
- Local time
- Today, 13:42
- Joined
- Apr 16, 2003
- Messages
- 48
In a vbokcancel msgbox, how do I get the cancel button to stop running a sub (i presume exitsub) and the ok button to run a macro. This is what I have so far . . . .
MsgBox "This will bring back details by MCC between the dates " & Forms!Frmmain!txtDate1 & " and " & Forms!Frmmain!txtDate2 & ".", vbOKCancel, "Sorted by date only."
If vbokCancel = 1 Then Exit Sub Else
If vbOKcancel = 2 Then DoCmd.RunMacro "Mcr_Frmmain to by MCC"
Exit Sub
End If
I read somewhere that the return values are: 1=OK 2=Cancel. Is this right? Any one have an idea?
Thanks.
MsgBox "This will bring back details by MCC between the dates " & Forms!Frmmain!txtDate1 & " and " & Forms!Frmmain!txtDate2 & ".", vbOKCancel, "Sorted by date only."
If vbokCancel = 1 Then Exit Sub Else
If vbOKcancel = 2 Then DoCmd.RunMacro "Mcr_Frmmain to by MCC"
Exit Sub
End If
I read somewhere that the return values are: 1=OK 2=Cancel. Is this right? Any one have an idea?
Thanks.