Bloosy
Technical User
- Jun 23, 2003
- 15
Hi everybody
I have a table name stored in a variable. Now is there any way that I can use that variable in SELECT statement.
Example:
Dim rs As Recordset
Dim whichmenu As string
whichmenu = "tablename"
.
.
rsname = "SELECT * FROM whichmenu WHERE field1 ='" &_ something & "'"
Set rs = db.OpenRecordset(rsname, dbOpenDynaset)
The point here is that I don't know the name of the table, it is only for simplicity
I have a table name stored in a variable. Now is there any way that I can use that variable in SELECT statement.
Example:
Dim rs As Recordset
Dim whichmenu As string
whichmenu = "tablename"
.
.
rsname = "SELECT * FROM whichmenu WHERE field1 ='" &_ something & "'"
Set rs = db.OpenRecordset(rsname, dbOpenDynaset)
The point here is that I don't know the name of the table, it is only for simplicity