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

Paremeter Queries

Status
Not open for further replies.

Brogrim

Technical User
Jul 28, 2000
184
IE
Can anybody help with a "parameter query". I have set up the patemeter query regarding start and end date for an invoice. The query then generates a report, the problem is the report does not save the parametes of the query and I have to keep
entering the information.

Sombody Please Help

Alan [sig][/sig]
 
Hi Alan,

well thats the general idea of parameters ;-)

if you mean that you want to include these in the report try basing the parameters on a form. add two text box's one for from date and one for the to date. then the user can enter the dates. add a button to print/preview the report. and finally change the parameters in the query to look for the dates on the form.

HTH [sig]<p>Robert Dwyer<br><a href=mailto:rdwyer@orion-online.com.au>rdwyer@orion-online.com.au</a><br>[/sig]
 
It sounds like you dont want to have to keep entering the same parameters when you do your report. If thats the case, you need to do a report based on a query for those particular dates, without parameters. Am I understanding you correctly.

[sig][/sig]
 
Thanx for the help, would i need to set up a form that would then generate the invoice. is so how will the query work? sorry for been such a fool

Alan [sig][/sig]
 
Hi Alan,

No not at all, the form is more a &quot;user report dialog&quot; that the user would be presented with, in a general way consider a small form that has say 2 textbox's on it for the user to enter the &quot;start&quot; date and &quot;End&quot; date and a button that calls the report. call this form &quot;AForm&quot; and the textbox for &quot;Start&quot; date &quot;StartDate&quot; and &quot;end&quot; date &quot;EndDate&quot;

i assume that the data source for the report is set to &quot;Aquery&quot; so in &quot;Aquery&quot; instead of having say
date criteria [Enter Start Date] in the &quot;Aquery&quot;
have
the criteria as
[Forms]![AForm]![StartDate]
and for the &quot;end&quot; date
[Forms]![AForm]![EndDate]
this will make the query look for the dates on the &quot;AForm&quot; form.

the button could have the following in the On Click event

DoCmd.OpenReport &quot;YourReportName&quot;, A_PREVIEW
' make sure we have focus on the form
Forms![AForm].SetFocus
' close the form
DoCmd.Close

A_PREVIEW previews the report
and A_NORMAL prints the report

now i don't know what sort of application you have but you need to have some way for the user to bring up this form when they want to print the report.
this should get you going ;-)

HTH

[sig]<p>Robert Dwyer<br><a href=mailto:rdwyer@orion-online.com.au>rdwyer@orion-online.com.au</a><br>[/sig]
 
Thanx a million for your swift responce. I can only say that this website has helped me finish my 1st little project and explained where I was fallen down. Only for it I would still be going around in circles. I'm still not out of the woods, thanx for ypur patience

Thanx again for all your help.

Alan [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top