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

Parameter crosstab query/extra prompting for values

Status
Not open for further replies.

bicit

MIS
Jul 14, 2004
11
US
I am having a strange issue regarding a report based in a Crosstab query which uses two datetime fields for arguments. It works fine when you run the query alone, prompts the user once for a starting and ending date, and returns the right result set. When I attempted to create a report using design view with the query as the source, I get prompted several times for the starting and ending dates before it will display the report. Is this normal Access behavior, or should I be creating the report in a different method?
Here's the query source, thanks for any insight:
--------------------------------------------------
PARAMETERS [Enter Staring date:] DateTime, [Enter ending date:] DateTime;
TRANSFORM Count(dbo_TempStats.ticketid) AS CountOfTicketID
SELECT dbo_TempStats.name, dbo_TempStats.datetime, Count(dbo_TempStats.ticketid) AS [Total Of TicketID]
FROM dbo_TempStats
WHERE (((dbo_TempStats.datetime)>=[Enter Staring date:] And (dbo_TempStats.datetime)<[Enter ending date:]))
GROUP BY dbo_TempStats.name, dbo_TempStats.datetime
PIVOT dbo_TempStats.description;
 
You should be entering your date parameters into controls on an open form. These control references replace your prompts. You would need to change your query -> parameters to something like:
Forms!frmDates!txtStart Date/Time
Forms!frmDates!txtEnd Date/Time


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]
[blue]Ask me about my grandson, get a grand answer.[/blue]
 
Duane,
can you explain how this would avoid the extra prompting? Thanks,
Mike
 
You just replace your "[Enter Staring date:]" in the criteria and parameters with reference to your form and control like:
Forms!frmDates!txtStart
Since the form is open the query will not need to ask you for the date value since it can pull the value directly from the control on the form.

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]
[blue]Ask me about my grandson, get a grand answer.[/blue]
 
Thanks Duane, I'll give that a shot.
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top