Copy Column Data

IanT

Registered User.
Local time
Today, 07:58
Joined
Nov 30, 2001
Messages
191
I have a column of data where the first record has a value, then the next records will not for so many records, then there is a value, this continues. How can I take the first value copy it into the blank fields until a value is found then that value is copied until the next value is found etc!


Thanks....
 
Something like:
Code:
dim rs as dao.recordset
dim myvar as String ' (assuming string)
set rs = currentdb.openrecordset("Select * from yourtable")
Do while not rs.eof
   If not isnull(rs!YourColumn) then
       myvar = rs!YourColumn
   else
       rs.edit
       rs!YourColumn = myvar
       rs.update
    endif
    rs.movenext
loop

Good luck!

P.s. Let me ask the obvious... WHY!???
 

Users who are viewing this thread

Back
Top Bottom