In my database, I have an existing query that I want to use with several different forms specifying date ranges.
Using VBA, is there any way to do the following:
1) Reference the query
2) Run an SQL statement on the query to obtain a subset of records that match my date criteria
3) Create a temporary recordset to export to Excel
This is the code selecting the subset of records...
strSQL = "SELECT * from qryInstalled Where Prod >= " & dtStart & " And Prod <= " & dtEnd & ""
Set rstTempFile = dbs.OpenRecordset(strSQL)
TIA,
Lisa
Using VBA, is there any way to do the following:
1) Reference the query
2) Run an SQL statement on the query to obtain a subset of records that match my date criteria
3) Create a temporary recordset to export to Excel
This is the code selecting the subset of records...
strSQL = "SELECT * from qryInstalled Where Prod >= " & dtStart & " And Prod <= " & dtEnd & ""
Set rstTempFile = dbs.OpenRecordset(strSQL)
TIA,
Lisa