Dim SQL As String
SQL = " INSERT INTO [Filtered " & [Forms]![ImportForm]![IDSelected] & " List]" & _
" SELECT ExcelDataFile.CompanyID, ExcelDataFile.Name," & _
" ExcelDataFile.Account, ExcelDataFile.invoice_no," & _
" ExcelDataFile.effective, ExcelDataFile.entry_date," & _
" ExcelDataFile.Room, ExcelDataFile.trans_type," & _
" ExcelDataFile.bank_code, ExcelDataFile.SalesRep," & _
" ExcelDataFile.paid, ExcelDataFile.amount," & _
" ExcelDataFile.commission, ExcelDataFile.duedate" & _
" FROM ExcelDataFile Where ExcelDataFile.CompanyID = " & _
[Forms]![ImportForm]![IDSelected] & ";"
DoCmd.RunSQL SQL
|