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!

Have query parameter display in report header textbox 1

Status
Not open for further replies.

nastar1

Technical User
Nov 1, 2005
122
US
I have a report based upon a query that prompts the user to enter a text string. I would like to display this text string in a text box or label in the header area of the report.

Any tips on how one would do this?

The query criteria is below:

Like "*" & [Enter search text:] & "*"

Would some code go into the Control Source field of the Text Box?
 
Add a text box to your report header with a control source of:
="You searched for: " & [Enter search text:]

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]
 
Exactly what I was looking for.

Thanks dhookum, you da man.
 
I noticed one additional thing that would be nice. If the user enters a parameter that does not result in any records selected, the textbox displays ERROR#.

Is there a way to defeat this and still have the textbox display the parameter input by the user?
 
=IIF([HasData],"You searched for: " & [Enter search text:],"You didn't return any records.")

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]
 
Another home run for you dhookum.

Spot on solution for what I needed.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top