On Oct 19, 5:16 pm, Qawi
> All, I have a table that has missing values for fields. I would like to know
> how to copy the contents of fields from a previous record to the current one.
> I attempted to do it in an update query but was unsuccessful. Also tried to
> create a macro that invoke
> suggestions would be appreciated. The table has thousands of records so
> manually copying the fields would be prohibitive.
you could use a recordset,
storing each field to a variable if the field is not null, and writing
from the variable if the field is null
The code below is untested, and needs to be adjusted to your table
dim rs as dao.recordset
set rs= currentdb.openrecordset("SELECT * from table order by ?????")
dim FldCount as integer
dim FldPointer as integer
FldCount = rs.fields.count
dim fieldvalues(FldCount)
do while not rs.eof
For fldPointer = 0 to FldCount - 1
if isnull(rs!fields(fldpointer)
fieldvalues(fldPointer) = rs!fields(fldpointer)
else
rs!fields(fldpointer) = fieldvalues(fldPointer)
end if
next fldpointer
loop