Good morning... I'm running into a syntax error. I'm sure the fix is simple (i.e., changing order of single or double-quotes). Any suggestions would be appreciated.
Please see the From / To below:
From (this works fine):
To (this is where I'm getting the syntax error):
Currently, I'm getting a syntax error "MS-Access DB engine cannot find the input table or query...". How should the last 2 "Set rs" lines be modified so that I can pass the values "Table_1" and "Table_2" into the db.OpenRecordset statements?
Thanks!
Please see the From / To below:
From (this works fine):
Code:
Set rs_Before = db.OpenRecordset("Table_1", dbOpenDynaset)
Set rs_After = db.OpenRecordset("Table_2", dbOpenDynaset)
To (this is where I'm getting the syntax error):
Code:
Dim TableBefore As String
Dim TableAfter As String
TableBefore = "Table_1"
TableAfter = "Table_2"
Set rs_Before = db.OpenRecordset("' & TableBefore & '", dbOpenDynaset)
Set rs_After = db.OpenRecordset("' & TableAfter & '", dbOpenDynaset)
Currently, I'm getting a syntax error "MS-Access DB engine cannot find the input table or query...". How should the last 2 "Set rs" lines be modified so that I can pass the values "Table_1" and "Table_2" into the db.OpenRecordset statements?
Thanks!