DoCmd.RunSQL command can be used to execute a SQL Statement. Since the SQL
Statement is comprised of text you can concateonate(sp) the statement as
neccessary to insert whatever values you need.
Such as
strSQL = "INSERT INTO tblTrailerActivityHeaders (
lngTrailerLoadLocation, txtTrailerLoadStatus, txtTrailerDispatchStatus,
dteTrailerLoadDate, txtTrailerDOTNumber, dblControlId ) SELECT " &
Me.pg2_cboTrailerLoadLocation & " AS Expr6, 'Loading' AS Expr5, 'Not Ready'
AS Expr4, #" & Date & "# AS Expr3, " & "'" & Me.pg1_lstSelectTrailer & "' AS
Expr2, " & dblControlValue & " AS Expr1;"
Or you can use DAO to insert the records directly as in...
Set db = dbEngine(0)(0)
Set rs = db.OpenRecordset("tblTrailerActivityDetailShows")
rs.AddNew
rs("lngTrailerActivityHeaderId") = lngExistingHeader
rs("txtShowNumber") = Me.pg2_cboSelectShow
varNewRecordId = rs("lngTrailerActivityDetailId")
rs.Update
rs.Close
Set rs = Nothing
Set db = Nothing
(The code samples are working with two completely different tables and are
not examples of how to do the same task with the same table. But the
principle is the same.)