Access '97.
I've built a report based on nested queries which require 5 parameters.
I can run the report and have it ask for each parameter in turn or run the query with parameters from the form.
How can I pass the form values into the report so I just have to call the report with the right parameters?
Could I run the query to a temporary table and then just report based on the table?
To run a query I:
Set db = CurrentDb
Set qdf = db.QueryDefs("qryreport")
' Set parameters for query based on values entered
qdf.Parameters![lowdate] = var_Low_Date
qdf.Parameters![highdate] = var_High_Date
qdf.Parameters![shiftcolour1] = var_Shift1
qdf.Parameters![shiftcolour2] = var_Shift2
qdf.Parameters![shiftcolour3] = var_Shift3
' execute the query
qdf.Execute
This works for make-table and append queries but doesn't appear to work for select queries.
I've built a report based on nested queries which require 5 parameters.
I can run the report and have it ask for each parameter in turn or run the query with parameters from the form.
How can I pass the form values into the report so I just have to call the report with the right parameters?
Could I run the query to a temporary table and then just report based on the table?
To run a query I:
Set db = CurrentDb
Set qdf = db.QueryDefs("qryreport")
' Set parameters for query based on values entered
qdf.Parameters![lowdate] = var_Low_Date
qdf.Parameters![highdate] = var_High_Date
qdf.Parameters![shiftcolour1] = var_Shift1
qdf.Parameters![shiftcolour2] = var_Shift2
qdf.Parameters![shiftcolour3] = var_Shift3
' execute the query
qdf.Execute
This works for make-table and append queries but doesn't appear to work for select queries.