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

Access 97 - Using parameters within a report control?

Status
Not open for further replies.

StevenB

IS-IT--Management
Sep 25, 2000
247
US
Hi everyone,

I need some help with a report I'm writing. The database is a hockey statistics database, and the report is based on a query that selects a certain group of players (qryActivePlayers). The controls on the report then calculate certain statistics, using data from another query (qryPlayerStats).

There are two criteria that are at the heart of my problem: "Season", which has values such as "1999-2000" and "2000-2001"; and "Game Type", which has three possibilities: "Regular", "Playoff", and "Tournament".

As it's currently written, I specify the criteria in qryPlayerStats, which means that each time I run the report, it runs for the same Season and Game Type, and in order to change those parameters, I have to change them within qryPlayerStats.

Obviously, what I'd like to have happen is that when I run the report, it asks me for the Season and the Game Type, so I could generate different reports ad hoc, such as "1999-2000 Playoff Stats" or "2000-2001 Tournament Stats".

I tried making Season into a parameter within the qryPlayer Stats by giving it a Criteria of [Season:], but the report doesn't prompt me to enter a value for that parameter. I think it's because qryPlayerStats isn't the main query that the report is based on, it's just referenced within the report controls.

Any ideas as to how I can make this work?

Thanks!
 
I'm not really sure why you have the colon in there.
Did you try
[Enter Season]
[Enter game Type]
-Smack
 
The colon is only in there so that the prompt shows up as:

Enter Season:

It's just text, not part of the code. Anyway, unfortunately I did try what you suggested, and when I run the report I never get asked to "Enter Season:".

Thanks!

Steve
 
Did you try adding the qryPlayerStats to qryActivePlayers and then entering the prompt criteria? I just tried this in a test mdb and it worked, but I had to have the expression in the main Q. When I placed criteria in the sub Q, and then added the sub Q to the main Q, I was not prompted. When I added the sub Q and the expression in the main Q, the prompts worked.
-Smack
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top