Cancel click of X

vmon

Registered User.
Local time
Today, 17:07
Joined
Jan 21, 2003
Messages
49
I have a form that is used for data entry and it does an add new record after and update. When the user clicks the X to close the form I want to prompt them to complete record yes or no. If they say yes how do I cancel the click of the X and put focus back in a text box. I have been trying several things. This is what it looks like right now.

myResponse = MsgBox("New Record Started...Do You Want To Complete Record? ", vbYesNo, "Complete New Record")
If myResponse = vbYes Then
Me.Undo
Cancel = False
Me.Qty.SetFocus
Exit Sub
Else
Cancel = True
Me.Undo
Docmd.Close
Exit Sub
End If


Thanks,
vmon
 
Try getting rid of the X all together and putting a Cancel button which will provide you with a little more flexibility.
 

Users who are viewing this thread

Back
Top Bottom