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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error if no matching Report

Status
Not open for further replies.

vivasuzi

Programmer
Jun 14, 2002
183
I have a report that gets info from a query. When the person opens the report, a pop up asks the first name they are looking for. If the first name is in the db, the report comes up fine. If the first name doesn't exists, the report comes up with #error everywhere.

Is there an easy way to display something else like "No records for first name of -first name entered-" ?

I'd like to show a message instead of just #error, since some people won't know that it isn't an error with the report. Thanx for any help :)

[cat2] *Suzanne* [elephant2]
[wavey] [wiggle]
 
Suzanne,

When the user clicks the report button,
1. Show an Input Box and ask for the name
2. Open a recordset and get the count for the entered name
3. If recordcount is > 0 then
'Open the report and show
Else
Msgbox "Invalid name"
'Do not open the report at all and exit
End

Hope this might help you.
 
Hi Suzanne -

Have a look at faq703-1594. It details exactly what you are trying to do.

Good luck

-Gary
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top