Hello:
I currently using the following to drop a table before re-importing the XLS.
Code:
Dim strSQL_Drop1 As String
strSQL_Drop1 = "DELETE tblSource1.* FROM tblSource1;"
CurrentDb.Execute strSQL_Drop1
In this example, the table name "tblSource1" is referenced two (2) times in my strSQL_Drop1 (2nd line). Thus, in case the table name changes, I need to update it in 2 places.
Instead, I'd like to use generic strCriteria statement. At the present time, however, I'm getting a syntax error... I'm sure it's missing a double-quote somewhere (or has one too many ").
The proposed code looks like this:
Code:
Dim strCriteria As String
strCriteria = tblSource1
strSQL_Drop1 = "DELETE " & strCriteria & ".* FROM " & strCriteria & ";"
CurrentDb.Execute strSQL_Drop1
Again, I currently encountering a run-time error '3075' ("Syntax error (missing operator) in query expression '.*'.
What's the correct syntax for making this change?
Thank you,
Tom