Copy the following Code into a Standard Module and save it:
Code:
Public Function CopyRecord(ByVal intblQry As String, ByVal outTbl As String)
Dim db As Database, rst1 As Recordset, rst2 As Recordset
Dim fldLoop1 As Field, fldLoop2 As Field, fldName As String, fldValue
Set db = CurrentDb
Set rst1 = db.OpenRecordset(intblQry, dbOpenDynaset)
Set rst2 = db.OpenRecordset(outTbl, dbOpenDynaset)
Do While Not rst1.EOF
rst2.AddNew
For Each fldLoop1 In rst1.Fields
fldName = fldLoop1.Name
fldValue = fldLoop1.Value
For Each fldLoop2 In rst2.Fields
If fldLoop2.Name = fldName Then
rst2.Fields(fldLoop2.Name).Value = fldValue
Exit For
End If
Next
Next
rst2.Update
rst1.MoveNext
Loop
rst1.Close
rst2.Close
Set rst1 = Nothing
Set rst2 = Nothing
Set db = Nothing
End Function
Run the Code with the following Syntax:
Code:
CopyRecord "QueryName", "TableName"