|
-
Jun 20th, 2001, 04:02 AM
#1
detecting EOF/BOF
i've made my own little kind of ADO data control with 2 buttons (previous & next) and a textbox to display the ID of the record. is there anyway i can detect if, when the user clicks Next and moves to another record, that the record following this record is the EOF marker, so that i can disable this button, and vice-versa for the Previous button? at the moment i'm using an error handler, so that when they hit the EOF marker, it drops in to the error handler and disables the button, but this seems like a pretty dodgy solution.
-
Jun 20th, 2001, 04:20 AM
#2
Addicted Member
Suppose 'Rs' is our RecordSet.
Code:
if Rs.EOF = True then
msgbox("You reached EOF!"),vbinformation
end if
same for previous:
Code:
if Rs.BOF = True then
msgbox("You reached BOF!"),vbinformation
end if
-
Jun 20th, 2001, 04:23 AM
#3
thanks, but that's not quite what i need. i found another way of doing what i have already, by using AbsolutePosition, but i need to know if the record they're currently on is the one just before the EOF marker, rather than knowing if they've just reached the EOF marker.
-
Jun 20th, 2001, 04:58 AM
#4
Frenzied Member
That's easy: when you press "Next", instead of moving one position, move TWO positions. If the current record says "EOF", move back one position and disable the "Next" button. If it doesn't, move back one position and enable the "Next" button. It's that easy
-
Jun 20th, 2001, 05:35 AM
#5
good idea although that may slows things up a bit, and it's already running fairly slow. i might just stick with disabling it when they reach EOF. thanks for the suggestions though
-
Jun 20th, 2001, 06:22 AM
#6
_______
<?>
Code:
Private Sub checkbtns()
'
' Check for button positions
'
rs.MovePrevious
cmdPrevious.Enabled = Not (rs.BOF)
rs.MoveNext
'
rs.MoveNext
cmdNext.Enabled = Not (rs.EOF)
rs.MovePrevious
'
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|