T
tina
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("TableName", dbOpenDynaset)
rst.AddNew
rst("TextFieldName") = "something"
rst("NumberFieldName") = 1
rst("Date/TimeFieldName") = #7/28/2007#
rst.Update
rst.Close
Set rst = Nothing
if you're new to Access (not just VBA in Access), suggest you consider
whether you need code to add a table record at all. if you can bind the
table to a form, and just enter the data directly to the table via the form,
that's quicker and easier.
hth
Set rst = CurrentDb.OpenRecordset("TableName", dbOpenDynaset)
rst.AddNew
rst("TextFieldName") = "something"
rst("NumberFieldName") = 1
rst("Date/TimeFieldName") = #7/28/2007#
rst.Update
rst.Close
Set rst = Nothing
if you're new to Access (not just VBA in Access), suggest you consider
whether you need code to add a table record at all. if you can bind the
table to a form, and just enter the data directly to the table via the form,
that's quicker and easier.
hth