Setting Value for All Records

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'd like to write a macro that changes the value of a field in ALL the records of a particular table at once to the same value. For example, changing the date in the "Date" field of all records in a table to "1/1/2004".

I can only seem to create a macro attached to a button on a form that changes the value in that particular record the form is displaying.

Thanks
 
What you want to do is run an update query, not the SetValue macro. An
update query lets you change the values of one or more fields in one or more
tables.

You can run such a query from a macro using the OpenQuery action (if the
query is saved).
--

Ken Snell
<MS ACCESS MVP>

Stephen said:
I'd like to write a macro that changes the value of a field in ALL the
records of a particular table at once to the same value. For example,
changing the date in the "Date" field of all records in a table to
"1/1/2004".
I can only seem to create a macro attached to a button on a form that
changes the value in that particular record the form is displaying.
 
You need to make an update query to do this.

Then you can run the query from your button.

Good luck.

Sco

Stephen said:
I'd like to write a macro that changes the value of a field in ALL the
records of a particular table at once to the same value. For example,
changing the date in the "Date" field of all records in a table to
"1/1/2004".
I can only seem to create a macro attached to a button on a form that
changes the value in that particular record the form is displaying.
 
Thanks everyone

M.L. Sco Scofield said:
You need to make an update query to do this.

Then you can run the query from your button.

Good luck.

Sco


records of a particular table at once to the same value. For example,
changing the date in the "Date" field of all records in a table to
"1/1/2004".
changes the value in that particular record the form is displaying.
 
Back
Top