A little ADO should get it. Just list all the data entry controls on your form following the rst.AddNew method.
Private Sub cmdAdNew_Click()
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
Dim strSQL As String
Set cnn = CurrentProject.Connection
Set rst = New ADODB.Recordset
strSQL = "SELECT FirstName, LastName FROM Employees"
rst.Open strSQL, cnn, adOpenKeyset, adLockOptimistic
With rst
rst.AddNew
!FirstName = txtFirstName
!LastName = txtLastName
rst.Update
End With
rst.Close: Set rst = Nothing
cnn.Close: Set cnn = Nothing
End Sub
Here I'm just saving the first and last name fields displayed on the form as a new record in the form's recordsource.
HTH,
Bob
|