I have a union query that contains around 760,000 records when run. Because of this, it takes some time.
I would like to make this more efficient because we will most likely never run this for everyone in the database, but rather using a select list of users.
i.e.
WHERE (UserID IN (id1,id2,id3...))
When I run a report my current VBA code is:
DoCmd.OpenReport rptName, , , SQLqry, , strArguments
the SQLqry code will have something like UserID IN (xxx)
but the query for the report has to run all 760,000 records then filter out those relevant.
Is there a way to actually change the reports SQL using VBA so that it initially draws only those USERID's relevant?
something like MyReport.RecordSource = BLAH BLAH
Thanks!
I would like to make this more efficient because we will most likely never run this for everyone in the database, but rather using a select list of users.
i.e.
WHERE (UserID IN (id1,id2,id3...))
When I run a report my current VBA code is:
DoCmd.OpenReport rptName, , , SQLqry, , strArguments
the SQLqry code will have something like UserID IN (xxx)
but the query for the report has to run all 760,000 records then filter out those relevant.
Is there a way to actually change the reports SQL using VBA so that it initially draws only those USERID's relevant?
something like MyReport.RecordSource = BLAH BLAH
Thanks!