pop up

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Could you help me add a function:
When a certain number is entered into a text box on a form, then the form
is closed, I need a pop-up or warning form to come up to ask a question.

Could you please help.
 
Could you help me add a function:
When a certain number is entered into a text box on a form, then the form
is closed, I need a pop-up or warning form to come up to ask a question.

Could you please help.

And the question is? And what do you want to do when it's answered?

In the form's UNLOAD event:

If Me!TextBoxName = 15 Then
If MsgBox("Are you sure you want to close?", vbYesNo) = vbNo Then
Cancel = True
End If
End If

The above will cancel the close if the No button is selected.
 
To answer your question "nothing" I only need an informational message to pop
up and allow the user to close the message.

Here is my code for the text box:
If IsNull(Me.MBR_GROUPNO) Or IsNull(Me.MBR_GROUPNAME) Or
IsNull(Me.MBR_COUNTYCODE) Then
If IsNull(Me.MBR_GROUPNO) Then
MsgBox "Please enter Group Number"
DoCmd.CancelEvent
End If

If Me.MBR_GROUPNO = 15 Then
If MsgBox("PLEASE US HIS NEW NUMBER?", vbYesNo) = vbNo Then
Cancel = True
End If
End If

If IsNull(Me.MBR_GROUPNAME) Then
MsgBox "Please enter Group Name"
DoCmd.CancelEvent
End If
If IsNull(Me.MBR_COUNTYCODE) Then
MsgBox "Please enter County"
DoCmd.CancelEvent
End If
Exit Sub
End If
 
Back
Top