Edit a recordset

  • Thread starter Thread starter Allie
  • Start date Start date
A

Allie

I have 10 fields in a datasheet sub form, if a particular
criteria is met 5 of those fields are added to a table
(tableB), using the recordset and the Addnew method.

If the value of one of the 5 fields changes I would like
to have it change in tableB. I have tried using the
recordset and the Edit method but it is adding another
record to tableB.

Any suggestions?

Thanks
 
Check the options you have set when opening the recordset.

You need to move to the record you want to edit, then use:

rs.edit
rs.Field1 = "X"
rs.Field2 = "y"
rs.update

Are you using ADO or DAO? Look under Tools/References when you are in the
Dev Environment. The syntax for the find method and the open method differs
between the two methods of data access. ADO is the newer method and is the
default from Access 2K onwards (though DAO still works in the latest
version).

I hope that is of some help.

Paul
 
Back
Top