PaulChilds
Technical User
- May 21, 2002
- 195
Hi,
I have a form which is based on a query. The criteria searches in a field called [Identifier].
This works great and brings up the data I need UNLESS the criteria returns a null result, and then the form comes up completely blank - just the background with no text boxes or buttons.
I was given a code which I was told would work, but doesn't. The code is supposed to close down the form if the [Identifier] field is empty, and then display a message telling the user to try again with a different number. Can any one suggest what I'm doing wrong?
Private Sub Form_Open(Cancel As Integer)
If IsNull(Identifier) Then
DoCmd.Close
End If
End Sub
Private Sub Form_Close()
MsgBox "You have entered an invalid code. Please
try another Identifier"
Response = acDataErrContinue
End Sub
I have a form which is based on a query. The criteria searches in a field called [Identifier].
This works great and brings up the data I need UNLESS the criteria returns a null result, and then the form comes up completely blank - just the background with no text boxes or buttons.
I was given a code which I was told would work, but doesn't. The code is supposed to close down the form if the [Identifier] field is empty, and then display a message telling the user to try again with a different number. Can any one suggest what I'm doing wrong?
Private Sub Form_Open(Cancel As Integer)
If IsNull(Identifier) Then
DoCmd.Close
End If
End Sub
Private Sub Form_Close()
MsgBox "You have entered an invalid code. Please
try another Identifier"
Response = acDataErrContinue
End Sub