Adding incremented values to a table
Adding incremented values to a table
(OP)
greetings
What is the best way in VBA to move down a column until the first null is encountered? (this isn't necessarily the last record in the table).
I'm using the following code now. It works fine, but it seems an inefficient method in very large tables. For example, I might have to move down 500,000 records before I find an 'absent' value of "Test".
...
rs.MoveFirst
Do While Not IsNull(rs("Test"))
rs.MoveNext
Loop
... .Edit / .Update code here to assign a value of "Test"
much thanks, teach314
What is the best way in VBA to move down a column until the first null is encountered? (this isn't necessarily the last record in the table).
I'm using the following code now. It works fine, but it seems an inefficient method in very large tables. For example, I might have to move down 500,000 records before I find an 'absent' value of "Test".
...
rs.MoveFirst
Do While Not IsNull(rs("Test"))
rs.MoveNext
Loop
... .Edit / .Update code here to assign a value of "Test"
much thanks, teach314
RE: Adding incremented values to a table
rs.FindFirst "Test Is Null"
Hope This Helps, PH.
FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions?
FAQ181-2886: How can I maximize my chances of getting an answer?
RE: Adding incremented values to a table
RE: Adding incremented values to a table
Teach314