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

Trouble handling input parameters for viewing a report

Status
Not open for further replies.

lizI3

Programmer
Jul 2, 2002
31
0
0
CA
I have two questions about how to handle paramenter in a report (run from a query).

First - if I enter a paramenter that produces a recordset with no data , how do I stop the report from being previewed. I just want a Message to come up No records for the data specifiec. I was going to use the Nodata event but thats for printing, I want to stop it from being previewed
I was also tring to use on error goto errhandler: but I did not know how to reference or refer to the parameter in the VBA statement.

The second question is - one of my parameters is a date (shortdate) field that asks for a start date and and end date. If the date is mm/dd/yy and the user enteres dd/mm/yy I want it to check for a valid date and if it is not a valid date send a message "Please enter a valid date". How do you refer to the date being imput by the user (that is asked for in the perameter) in is case a date which is to match a biweeklydate field in a query?

I would be greatfull for tips

thanks
liz
 
With regard to question 1, see faq703-1594

On the second, instead of prompting for a date from the query, you might think about having a date field on a form (with the format set to mm/dd/yy and the input mask set to 99/99/0000;0;#) forcing the user to input a valid date.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top