Insert Into Query
The insert into SQL statement is the DML (data manipulation language) command to use to append new records to a
table in your relational database.
The basic syntax of the Insert Into SQL query for a single record is:
Insert Into TableName (FieldName1, FieldName2) Values (Value1, Value2);
For multiple records gathered from other tables or external sources
the Access insert into SQL query is slighty different:
Insert Into TableName (FieldName1, FieldName2) Select FieldName1, FieldName2 From TableName;
The full syntax of the Access insert into SQL query statement from Microsoft Access help is:
INSERT INTO target [IN externaldatabase] [(field1[, field2[, ...]])] SELECT [source.]field1[, field2[, ...] FROM
tableexpression;
Where:

Note: The ending semicolon is a required component of all SQL statements.
Now the insert into query with real column and table names for a single row:
Insert Into M_Employees (Emp_ID, Emp_Name, Emp_Start_Date) Values (00212, "Joseph Dean", #01/02/06#);
Note that text values are bounded by quote marks and date values are bounded by pound signs
in the insert into query.
Multiple row inserts using the select statement alternative - a
variation of the insert into query.
Insert Into M_Employees (Emp_ID, Emp_Name) Select Emp_ID, Emp_Name From MyLinkedSpreadsheet Where Emp_Status="New";
Note that we restrict the number of records to only those records with a status value of 'New".
More Append Query Examples:
SQLText = "INSERT INTO T_Orders (
Order_Numb, ITEMDESC, XTNDPRCE, QUANTITY ) SELECT SOPNUMBE, ITEMDESC,
XTNDPRCE, QUANTITY " & _ ...
www.blueclaw-db.com/docmd_runsql_example.htm |
RunSQL ("INSERT INTO T_Patient_alrgy (
Patient_ID, Allergy ) " & _ " SELECT " & Patient_ID & ",'" & hold_alrgy &
"'") End Function ...
www.blueclaw-db.com/concatenate_multiple_records_one_field.htm |