The following code gives me an error "Syntax error in INSERT INTO Statement. I have checked the destination table to be sure that the column headings match. I also checked the data types of the variables in the from and to tables to be sure that they match. Any other ideas of where the syntax error might be?
Thanks
Public Sub Form_Load()
Dim rstline As New ADODB.Recordset
rstline.LockType = adLockOptimistic
strSql = "insert into tblOrderEntryLine(Index,CUSTNMBR,CUSTNAME) select Index,CUSTNMBR,CUSTNAME from tblOrderEntryMaster where Index = " & Forms!FrmNewInvoice!txtIndex
rstline.Open strSql, CurrentProject.Connection
Thanks
Public Sub Form_Load()
Dim rstline As New ADODB.Recordset
rstline.LockType = adLockOptimistic
strSql = "insert into tblOrderEntryLine(Index,CUSTNMBR,CUSTNAME) select Index,CUSTNMBR,CUSTNAME from tblOrderEntryMaster where Index = " & Forms!FrmNewInvoice!txtIndex
rstline.Open strSql, CurrentProject.Connection