Loop through fields and update nulls to zero's



How would you loop through fields and update null values to zero's in vba?
If it was only one field, I would run a query or write an SQL statement.

I've seen many posts similar, but I can't get it to work. Here is my code.

With rst
Do Until .EOF
For I = 0 To rst.Fields.Count - 1
If rst.Fields(I).Value = Null Then
rst.Fields(I).Value = 0
rst.Update
End If
Next I
.MoveNext
Loop
.Close
End With

Please help me with this

Arlene
.



Relevant Pages

  • Re: Save report letters to file
    ... I was beginning to think i would have to resort to VBA. ... ...save report for individual record ... first of all how do i loop through the records of a query ...
    (microsoft.public.access.macros)
  • Append Query VBA help
    ... I would appreciate your assistance with some VBA. ... a semi-structured vertical format and have worked through how to get this ... The logic for the query is below: ... "F19" is the variable that I want to change each time in the loop. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Appending one row at a time
    ... This may be accomplished by using a for loop and a counter inside VBA. ... you would have to run the query from a Form. ... that you are appending. ...
    (microsoft.public.access.queries)
  • Re: Tricky Delete Problem
    ... I can't think of a way to do this with a query. ... It would require some VBA ... in a database. ... Prev by Date: ...
    (microsoft.public.access.queries)
  • Using VBA to disable macros when opening files
    ... I am using VBA to create a loop to open up a number of XL files - however I ... want disable any macros that the files may contain when opening these files ... Prev by Date: ...
    (microsoft.public.excel.programming)