Change values back to zero

D

Donna

In a form that is linked to both a query and tables, I need to change all the
values in a particular field back to 0 (zero) to start a new year's worth of
data.

is there a way to set this up with a macro or some other way, other than to
just scroll thru every record and type in the 0?

I can't seem to get it right.
 
O

Ofer Cohen

First Back up your data.

Create a button on the form that run two things
1. You can use an update query to update a field to a certain value

Docmd.RunSql "UPDATE TableName SET TableName.[FieldName] = 0"

That incase you want to update all the records, with no filter

2. After running the SQL you need to refresh the form.
Me.Requery
 
J

Jim Jackson

Have you tried something like this?

For Each cell In Range("J2:J200") ' Change this to suit your cell range(s)
If cell.Offset(0, 0) > "0" Then
cell.Offset(0, 0) = "0"

End If
Next cell

Jim
 
Top