C
Cheyenne
Is there a way to create a custom error message or pop up window in a form
when a value is not found?
when a value is not found?
Cheyenne said:Is there a way to create a custom error message or pop up window in
a form when a value is not found?
Cheyenne said:I have created a 'search' form based on table which has 3 columns:
Account Name, Telephone Number, and Account Number. The form is set
up so that when an account number, telephone number, or account name
is entered into one of the blank text boxes, and the search command
button is clicked, a query opens showing the corresponding
information. My problems is that when an entry is not found, the
query still opens but shows a blank row where the appropriate
information should be. What I would like to do is fix this so that
instead of even opening the query when the record can't be found, an
error message would pop up with something like "RECORD NOT FOUND". I
know it might seem a little confusing but hope i've made myself
clear. I can post VB or SQL codes if needed.
Thanks.
-Cheyenne
Cheyenne said:Actually, I have 3 text boxes (one for each search field: bill name,
acct#,tel#)
I have only 1 search command button. when text is entered into either
of the text boxes and the search button is clicked, the query opens
shows the corresponding record. Here is the VB code that i'm
currently using:
Private Sub Command10_Click()
On Error Resume Next
If Not IsNull(Me.ACCOUNT_NUMBER) Then
DoCmd.OpenQuery "queryaccountnumber", acViewNormal
Else
If Not IsNull(Me.BILL_NAME) Then
DoCmd.OpenQuery "querybillName", acViewNormal
Else
If Not IsNull(Me.TELEPHONE_NUMBER) Then
DoCmd.OpenQuery "querytelephonenumber", acViewNormal
End If
End If
End If
End Sub
Since my code is pretty detailed , i'm not sure how to incorporate
the code you suggested. Please advise. Thanks.