You can create a query in the BE to limit the recordset that you need for your report, and then just transfer the results of the query. This will keep the wire cool.
You would do something like:
'---------------------------
DoCmd.SetWarnings False
DoCmd.RunQuery "qryDELETEfromYourTable"
DoCmd.TransferDatabase transfertype:=acImport, _
databasetype:="Microsoft Access", _
databasename:="Z:\Data\Database_be.mdb", _
objecttype:=acTable, Source:="qryYourQuery", _
Destination:="tblYourTable"
DoCmd.SetWarnings True
'---------------------------
DoCmd.SetWarnings False turns off your application warnings for the Delete query coming up.
The Delete query empties the local table for new data. You have to build the delete query yourself.
DoCmd.TransferDatabase takes the results of the query on your back end, and shoves it into your local table that you just cleaned out. This is the temp table, but not really since it is permanent.
DoCmd.SetWarnings True turns your warnings back on.
HTH
mmcdonal
|