Each day ~5000 records are uploaded to tblRecordsCurrent, at some point within the next few days when those records have been processed, they need to be moved to tblRecordsHistorical. Each record has a Foreign Key DataSetID that ties it to the date/time it was uploaded (Parent Table).
How, within vba, can I insert a single DataSet of tblRecordsCurrent into the tblRecordsHistorical from tblRecordsCurrent. I cannot insert all columns as both tables contain persisted columns.
I can’t put the entire INSERT INTO tblRecordsHistorical A, B, C, D, E, F... as it is too long for access vba.
Any ideas?
If you save the query in your Access database, then you can execute in in VBA the following way:
Or
Or
This allows you to execute the query without having the query stored in your VBA code. But you are also able to execute this via a query in
VBA:EDIT:
You can create a long SQL string by concatenating the string together: