Jim,
The Jet Expression Service knows nothing about VBA variables, so you have to
supply the *value* of the variable, not its name.
StrSQL = "INSERT INTO MyTable_temp " & _
"SELECT MyTable.* " & _
"FROM MyTable " & _
"WHERE [MyTable].[syllcode] = """ & Syllabus & """"
Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------
>I am trying to populate a new table (Tbl_MyTable_Temp) with records from an
> existing table (Tbl_MyTable). The records to be included are determined
[quoted text clipped - 30 lines]
> Jim Jones
> Botswana
Jim Jones - 30 Jul 2006 13:35 GMT
Graham
Many thanks for the prompt response. Your solution worked immediately, and
I can now get on with the job.
I could see that the variable was not being recognized when it was part of
the SQL statement, but finding out how what to do in such circumstances is
difficult for a VBA novice such as myself. That's why this site is so useful
to folk like me - being able to take advantage of the expertise of MVP's such
as yourself is invaluable.
Many thanks again
Jim Jones
Botswana
> Jim,
>
[quoted text clipped - 46 lines]
> > Jim Jones
> > Botswana