V
vm
I am connecting to an access db via vb6. I have put the standard 4 buttons
for First Record, Previous Record, Next Record, & Last Record. The buttons
for First & Last record work well, they are justrs.movefirst & rs.movelast.
The problem is with the previous & next buttons whenit comes to the first &
last record respectively.
My code for the previous button is:
if rs.BOF = true then
rs.movefirst
else
rs.movePrevious
displayIt '{DisplayIt is a sub to fill values into text fields}
end if
The problem is that rs.BOF is never true. Even when I move to the first
record, the rs.BOF is false. The same is true of the next button using the
rs.EOF check. It is always false. Of course since it is false it tries to
display the previous {and next} record - it errors out with "No current
record"
This seems simple enough, but why won't the BOF & EOF flag true if it is at
the beginning or end of file. All other aspects of the code with the db is
working perfectly, new, delete, search, update.
Any ideas?
vm
for First Record, Previous Record, Next Record, & Last Record. The buttons
for First & Last record work well, they are justrs.movefirst & rs.movelast.
The problem is with the previous & next buttons whenit comes to the first &
last record respectively.
My code for the previous button is:
if rs.BOF = true then
rs.movefirst
else
rs.movePrevious
displayIt '{DisplayIt is a sub to fill values into text fields}
end if
The problem is that rs.BOF is never true. Even when I move to the first
record, the rs.BOF is false. The same is true of the next button using the
rs.EOF check. It is always false. Of course since it is false it tries to
display the previous {and next} record - it errors out with "No current
record"
This seems simple enough, but why won't the BOF & EOF flag true if it is at
the beginning or end of file. All other aspects of the code with the db is
working perfectly, new, delete, search, update.
Any ideas?
vm