Hello,
I have created a variable that records the names of all the tables in my database. (i.e. TBLNMLST)
I also have a Variable that is unique to each user. (i.e. USRID)
I want to check the USRID variable against the TBLNMLST variable to see if there is an existing table in the database, with the same name as the USRID value.
If the value of USRID does not match any of the table names in the database, then I want to create a table with the USRID value as it's name.
The problem I'm having is with the setup of the "IF...NOT IN LIST...THEN" statement. How can I properly create this statement so that I can trigger the creation of a new table?
Dim T As TableDef, TBLNMLST As String, DB
Set DB = CurrentDb
For Each T In DB.TableDefs
TBLNMLST = TBLNMLST & T.Name & ";"
Next
If USRID Not In (" & TBLNMLST & "
Then...
I can make this type of statement work within a SQL "SELECT" query, but how can I create this kind of statement to trigger the creation of a table???
Please let me know,
Thanks,
Blair
I have created a variable that records the names of all the tables in my database. (i.e. TBLNMLST)
I also have a Variable that is unique to each user. (i.e. USRID)
I want to check the USRID variable against the TBLNMLST variable to see if there is an existing table in the database, with the same name as the USRID value.
If the value of USRID does not match any of the table names in the database, then I want to create a table with the USRID value as it's name.
The problem I'm having is with the setup of the "IF...NOT IN LIST...THEN" statement. How can I properly create this statement so that I can trigger the creation of a new table?
Dim T As TableDef, TBLNMLST As String, DB
Set DB = CurrentDb
For Each T In DB.TableDefs
TBLNMLST = TBLNMLST & T.Name & ";"
Next
If USRID Not In (" & TBLNMLST & "
I can make this type of statement work within a SQL "SELECT" query, but how can I create this kind of statement to trigger the creation of a table???
Please let me know,
Thanks,
Blair