Use AddNew method from Recordset and two arrays to add a new row
Public Sub addCustomerArray()
Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset
Set conn = CurrentProject.Connection
Set rs = New ADODB.Recordset
rs.Open "tblCompany", conn, adOpenDynamic, adLockOptimistic, adCmdTable
varfields = Array("CompanyName", "Address", "City")
varValues = Array("A", "Road", "B")
rs.AddNew varfields, varValues
rs.Update
End Sub
Related examples in the same category