swedish_mania
Registered User.
- Local time
- Today, 03:54
- Joined
- Feb 8, 2005
- Messages
- 43
Im want to create a msgbox that pops up when a parameter is entered wrong.
Ive created a query to search for customers - When run a box pops up saying 'Please enter surname' - If correct then a record appears.
If the surname is incorrect i get a blank table. I want a msgbox to pop up saying something like 'No Records Found. Please Try Again'.
Ive also created a button on a form which runs the query, this works fine:
Private Sub Command0_Click()
On Error GoTo Err_Command0_Click
Dim stDocName As String
stDocName = "Customer Search"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Exit_Command0_Click:
Exit Sub
Err_Command0_Click:
MsgBox Err.Description
Resume Exit_Command0_Click
End Sub
How can i change this so a msgbox appears if nothing is found?
Any suggestions welcome. Thanks in advance...
Ive created a query to search for customers - When run a box pops up saying 'Please enter surname' - If correct then a record appears.
If the surname is incorrect i get a blank table. I want a msgbox to pop up saying something like 'No Records Found. Please Try Again'.
Ive also created a button on a form which runs the query, this works fine:
Private Sub Command0_Click()
On Error GoTo Err_Command0_Click
Dim stDocName As String
stDocName = "Customer Search"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Exit_Command0_Click:
Exit Sub
Err_Command0_Click:
MsgBox Err.Description
Resume Exit_Command0_Click
End Sub
How can i change this so a msgbox appears if nothing is found?
Any suggestions welcome. Thanks in advance...
