Hello,
I have a database that asks the user for many inputs and stores them in variables. From these variables a table name is created. Like so:
Where userCircuit, userStart, and userEnd are all variables. I am attempting to add information to this table that is created by this statement:
isnstead of "Table1" I want the table to be the table I created with the first set of code. I attempted to replace "Table1" with "userCircui t & "-" & userStart & "," & userEnd" but I get a syntax error. I have attempted many things and could not figure this out. I am sure it is something incredibly simple being that I have never worked with VBA before, but I just cant point it. Thank You!
My most current attempt I saved the 3 seperate variables into one string variable, so I end up with:
so all that is left to be done is to figure out how to have it identifiy "tableName" as a variable instead of actually the word "tableName"
Seth
I have a database that asks the user for many inputs and stores them in variables. From these variables a table name is created. Like so:
Code:
'Specify table name
Set tbl = dbs.CreateTableDef(userCircuit & "-" & userStart & "," & userEnd)
Code:
DoCmd.RunSQL ("INSERT INTO Table1 ([Field1])VALUES(Cable_Start)")
My most current attempt I saved the 3 seperate variables into one string variable, so I end up with:
Code:
DoCmd.RunSQL ("INSERT INTO tableName([Field1])VALUES(Cable_Start)")
Seth
Comment