dim rs as dao.recordset
Dim pDate As String, pPName As String, pRName As String
Dim pILight As String, pALight As String, pFLight As String, pDesc As String
Const sqlM = "INSERT INTO tempImplantManagement " & _
"( DOS, PName, RName, ImplantLight, AbutLight, FinalLight, Desc) " & _
"VALUES " & _
"( pDate, pPName, pRName, pILight, pALight, pFLight, pDesc )"
set rs = currentdb.openrecordset("anothertable")
strImplantLight = mydate1
strAbutLight = mydate2
strFinalLight = mydate3
Dim qdf As dao.QueryDef
Set qdf = CurrentDb.CreateQueryDef("", sqlM)
With qdf
.Parameters("pDate") = rs!nDate
.Parameters("pPName") = rs!PName
.Parameters("pRName") = rs!RName
.Parameters("pILight") = strImplantLight
.Parameters("pALight") = strAbutLight
.Parameters("pFLight") = strFinalLight
.Parameters("pDesc") = rs!Desc
.Execute dbFailOnError
.Close
End With
Set qdf = Nothing
set rs = nothing