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

error appearing when running a parameter query via a report

Status
Not open for further replies.

balllian

MIS
Jan 26, 2005
150
GB
when i run a report which has a underlying parameter query for a date range an error comes up on the report where the date field shows. Is there a way i can get a blank report to appear with the date range on and not for a error message to appear.
 
the parameter in the query requests two date ranges. if there are no records to be returned the date rnage which normally shows on the report when this is just says error in the report where the date range appears on the report.


="Between" & [First date] & " and " & [Second Date]

this is contained in a text box
 
ballian,
Don't use parameter prompts. They are very limiting. Get your criteria from controls on forms. You can then have a criteria like

Between Forms!frmDates!txtFirstDate and Forms!frmDates!txtSecondDate

The control source on your report will be:
="Between " & Forms!frmDates!txtFirstDate & " and " & Forms!frmDates!txtSecondDate

I have seen suggestions in the past to use Nz(). Don't bother even trying this.


Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top