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

Dcount using existing Parameter query 1

Status
Not open for further replies.

smeyer56

IS-IT--Management
Oct 16, 2002
206
US
I am using a parameter Query to look up data by location. The query prompts for location:
Like "*" & [Enter any letters to search by: ] & "*"
I am creating a report on who attended a conference so the query also filters on a yes/no for attendance. I would like to also report how many people registered but do not want them shown on the report.
I have been trying this using a dcount in the query and it works if I hard code the location in as a criteria like so:
DCount("Registered","qryRegisteredAllLocation","Location ='St. Louis'")
but I would like to use the parameter already entered for location like so:
DCount("Registered","qryRegisteredAllLocation","Location ='Location Entered Already")

Is this possible?
 
I recommend against using parameter prompts every chance I get. They are not very flexible or user-friendly. I much prefer values from controls on forms.

However, you can try:
DCount("Registered","qryRegisteredAllLocation","Location Like '*" & [Enter any letters to search by:] & "*'")

or possibly:
DCount("Registered","qryRegisteredAllLocation","Location = '" & [Location] & "'")




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]
 
I thought about that but I thought that would just ask me to enter a parameter that I already prompted for. I will try this.
 
Just tried that and it works great. Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top