I am slowly coming to grips with SQL but this is bugging me.
I have resorted to using the following when using a variable in the from clause.
Which seems a bit clunky.
Sometimes, but not always this seems to work
and other times it is this
The string "sTable" can be dimmed in the sub / function, it can be passed as a parameter or extracted from form.recordsource.
What is the syntactically correct way to do this?
I have resorted to using the following when using a variable in the from clause.
Code:
"FROM [" & sTable & "] as A " & _
Which seems a bit clunky.
Sometimes, but not always this seems to work
Code:
"FROM sTable as A " & _
and other times it is this
Code:
"FROM [sTable] as A " & _
The string "sTable" can be dimmed in the sub / function, it can be passed as a parameter or extracted from form.recordsource.
What is the syntactically correct way to do this?