wizcow
Registered User.
- Local time
- Today, 09:23
- Joined
- Sep 22, 2001
- Messages
- 236
Hi
I want to have a message pop up when a certain text box is not filled in. I want the msgbox to give the option of 'Retry' then vb will put the focus on the empty text box. If the 'Cancel' button is clicked, then the form will close and not store the record.
This is the code I am wroking on and it just closes the form, no matter what button I click. Please let me know if you see what I have missed.
Private Sub Form_Unload(Cancel As Integer)
If IsNull(ISBN = "") Then
If vbRetry = MsgBox("Make an entry in the 'ISBN'." , 53, "Error Handler") Then
DoCmd.GoToControl "ISBN"
Exit Sub
End If
Cancel = True
DoCmd.Close
End If
End Sub
I want to have a message pop up when a certain text box is not filled in. I want the msgbox to give the option of 'Retry' then vb will put the focus on the empty text box. If the 'Cancel' button is clicked, then the form will close and not store the record.
This is the code I am wroking on and it just closes the form, no matter what button I click. Please let me know if you see what I have missed.
Private Sub Form_Unload(Cancel As Integer)
If IsNull(ISBN = "") Then
If vbRetry = MsgBox("Make an entry in the 'ISBN'." , 53, "Error Handler") Then
DoCmd.GoToControl "ISBN"
Exit Sub
End If
Cancel = True
DoCmd.Close
End If
End Sub