Full Version: Passing a value from form as a parameter to a query??
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
GotAccess
Hi all,
Can anybody explain how to pass a value which is in a drop down menu as a parameter to a query which will be the record source for a report...

Riaz
argeedblu
Riaz,

On the criteria row of the query enter the expression Forms!Formname!controlname , substituting your form name and cotrol name. The form must be open when the query runs.

Glenn
fkegley
Adding to Glenn's post, I usually put a command button on the form that opens the query and/or report.
GotAccess
Ya, I have tried that... Attaching a sample dbase...
but here is what I am looking for...
The report displays all the case count for 12 months...and it is for different years...
I need a form that will accept year as input and will open the same report displaying records for only that year...
I hope I am clear.
fkegley
I do not have the report working. However, I did manage to get the crosstab query to work using a date entered from the form. Crosstab queries are different animals from the normal run of the mill select queries.

I have attached my work. Form1 is the form that matters. I also changed the Crosstab query by putting an entry in the Parameters dialog box.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.