updating field table

  • Thread starter Thread starter Rani
  • Start date Start date
Rani said:
what is the syntax to update a field in a table using code ?

On a particular row or on all rows? Usually the most efficient way to
modify data in tables is with an Update Query. You can execute Update
queries from code either by executing a saved query or by executing a SQL
string.

CurrentDB.Execute "Some QueryName or SQL String", dbFailOnError

You can also open a Recordset on the table and use the Edit method to
change the record, but that is normally restricted to situations where the
calculation required to do the update is fairly complex as it is less
efficient than a set-based operation using SQL. This would also be
appropriate when you need to do updates "sequentially" meaning that the
update I do on row 4 depends on values found in row 3 (for example).
 
Back
Top