Query not working ( Inserting table based on value from a query)

V

Vandy

Hi,
I am trying to insert a table (tabtest) based on the value(accountno)
from the query (qryemployee).
This is the query I have,

strInputFileName = EmployeeName
strSQLtemp = "select accountno from qryEmployee"
strSql = "Insert into tabtest (AccountNo,Name) values (" & accountno &
",""" & strInputFileName & """)"
strSql = strSql & "where accountno in ( """ & strSQLtemp & """ );"

But I am getting error as the semicolon missing at the end of SQL
statement.

I have doubt on the field accountno. Is that correct?

Could you please help me to resolve this?

Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top