I have the following lines of code:
Dim Temp AS String
Temp = Forms("Form1").[Name1].Value 'in this case Temp refers to 'Don'
SQL = "INSERT INTO [Table2](Name1) SELECT [Table1].[Name1] FROM [Table1] WHERE ([Table1].[Name1]=Temp)"
DoCmd.RunSQL SQL
The error message is to input the parameter "Temp".
I have come to the conclusion after much experimenting that the WHERE clause
will not accept a variable for the object of the clause. It will work when I use
a string, such as 'Don' instead of Temp.
Can someone verify that I am correct in this case? And, if so, is there some kind
of work around for it?