By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,289 Members | 1,793 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,289 IT Pros & Developers. It's quick & easy.

FillDown in Access

P: n/a
I was able to use this code .

Sub test()
Dim db As Database
Dim rs As DAO.Recordset
Set db = CurrentDb()
Set rs = db.OpenRecordset("booked")

While Not rs.EOF
If Not IsNull(rs(1)) Then
Strng = rs(1)
End If
rs.MoveNext
If IsNull(rs(1)) Then
rs.Edit
rs(1) = Strng
rs.Update
End If

Wend

End Sub

This update the 1st field in table 'booked' where there is a blank
field it fills in the value of the previous record..
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Stephen H wrote:
I was able to use this code .

Sub test()
Dim db As Database
Dim rs As DAO.Recordset
Set db = CurrentDb()
Set rs = db.OpenRecordset("booked")

While Not rs.EOF
If Not IsNull(rs(1)) Then
Strng = rs(1)
End If
rs.MoveNext If not rs.EOF Then If IsNull(rs(1)) Then
rs.Edit
rs(1) = Strng
rs.Update
End If Endif
Wend

End Sub

This update the 1st field in table 'booked' where there is a blank
field it fills in the value of the previous record..


You might want to check for EOF status after moving next.
Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.