Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need my parameter query to prompt the user "No Records Found"

Status
Not open for further replies.

Kayo

Programmer
Aug 13, 2001
28
US
I have a basic parameter query that asks the user to enter a social security number. Currently, if no record is found, the system shows a blank record. I need the system to prompt the user that "No Records Found" via msgbox.
 
You cannot alter the output of the query in this way.
You need to run the query from a button on a form that has a textbox into which the user enters the ssn.
When the button is clicked, you can then run some code to count the records (using Dcount()). If there are none, you can display a messagebox otherwise you can run the query (which would use the texbox on the form for its ssn value)>
 
I have this code in my REPORT to say no records found. Maybe this can help somehow??

Private Sub Report_NoData(Cancel As Integer)
MsgBox "There are no records for the timeframe you entered."
Cancel = True

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top