Update Blanks Based on Previous Fields

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

Guest

I have a table with the ID as Primary Key. This keeps the records in
"order". The table looks like this:
1 Value
2 Blank
3 Blank
4 Value
5 Blank

I need records 2 and 3 to be updated to the Value in record 1 and record 5
to be updated to the Value in record 4. I read another post of someone that
provided code to do this but I never saw anyone state that it actually
worked. In essence I need all Blank fields in a column to look "up" and find
the next non-blank field and populate itself with that value.
Thanks,
Ted
 
The best way to test if code actually works is to back up your data and then
try the code. Otherwise if you want some opinion on whether or not it will
work, post the code and ask.
 
Psuedo code would be something like:

open recordset
do until .eof
If IsNull(somefield) Then
update with saved value
Else
save value
End If
.movenext
Loop
 
Back
Top