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!

Parameter drop-down list for report 1

Status
Not open for further replies.

dolodolo

Technical User
May 27, 2003
86
US
Hi,

I have a report based on a query that calls for a parameter to be input at runtime(single-click). I'd like to have that parameter be a drop-down list.

Any help would be much appreciated.

Dolores
 
Use a ComboBox in a parameter(s) form having a button to launch the report.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks for the help. How do I create a parameter Form?
 
Have a look here:
faq701-6763

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I tried the following - it almost works. The problem is that it is calling the query, and the report, and the query parameter window. I'd like it to just call the parameter form and then preview the report.

This is the code on the OK button in the form:

Private Sub OK_Click()
Me.Visible = False
DoCmd.OpenQuery "qryBudgetByRegion", acViewNormal, acEdit
DoCmd.OpenReport "qryBudgetByRegion", acViewPreview
'DoCmd.Close acForm, "Select Region", acSaveNo
End Sub
 
Do you really have a report with the same name as a query ?
You shouldn't get the query parameter window following the way I suggested you.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Yes, the names are the same. I'll clean them up when this all works. I added a line to close the query window which works but I am still getting the query parameters. I'll take another look at what you suggested. Where does this code go?

SELECT tblSales.*
FROM tblSales
WHERE SaleDate Between Forms!frmDates![txStartDate] and Forms!frmDates![txtEndDate]

Thanks very much!
 
This is the select statement on my query:

PARAMETERS Region Text ( 255 );
SELECT
tblBudgetPurchase.PropertyNbr, tblBudgetPurchase.Manufacturer,
tblBudgetPurchase.Model,
tblPriceList.Price,
tblBudgetPurchase.Qty,
(tblPricelist.price*[qty]) AS ExtendedCost, tblBudgetPurchase.Year,
Property.[Property name],
Property.Property,
Property.Region

FROM ((tblBudgetPurchase INNER JOIN tblPriceList ON (tblBudgetPurchase.Manufacturer = tblPriceList.Manufacturer) AND (tblBudgetPurchase.Model = tblPriceList.Model) AND (tblBudgetPurchase.Year = tblPriceList.Year)) INNER JOIN Property ON tblBudgetPurchase.PropertyNbr = Property.Property) INNER JOIN [Master-Region] ON Property.Region = [Master-Region].Region

WHERE (((tblBudgetPurchase.Qty)<>0) AND ((Property.Region)=[Forms]![Select Region]![Region]));
 
Get rid of the first line:
PARAMETERS Region Text ( 255 );

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top