I am trying to use the INSERT INTO Statement without defining my column field names. I know this is possible but i am jus not able to do it. The SQL string i currently have is,
Code:strSQL = " INSERT INTO MLE_Table (pnr, [Overall Assesment], risk, reason, justification)" & _ " SELECT tbl_Import.pnr, tbl_Import.[Overall Assesment], tbl_Import.risk, tbl_Import.reason, tbl_Import.justification " & _ " FROM tbl_Import;"
now, in this code i have used my field names. but I dont want to do that. I want the SQL to insert fields into the new table only when the field names of both tables match.
I think it can be done by a For Each Loop, but I am not sure.
Is there anyone who has done this before.. I am using MS Access 2010.
Thanks a lot!!




Reply With Quote
