Private Sub Form_Unload(Cancel As Integer)
If txtbox1 = "Enter here" Then
MsgBox "Please enter data into first textbox"
txtbox1.SetFocus
Cancel = True
ElseIf txtbox2 = "Enter here" Then
MsgBox "Please enter data into second textbox"
txtbox2.SetFocus
Cancel = True
End If
End Sub
|