Full Version: disable previous button
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
board
in the form current event i use this code to disable next button if on last record

'disable next button when on last record give focus to previous
If Me.NewRecord = True Then
[previous].SetFocus
[next].Enabled = False
Else
[next].Enabled = True
End If

What can i use to disable the previous button if on the first record.

Cheers
ScottGem
Test for BOF
adamsherring
Hi.

Try using the CurrentRecord Property. It will be set to 1 for the first record.

Hope that works for you,

Adam
board
'disable previous button when on first record give focus to next
If CurrentRecord = 1 Then
[next].SetFocus
[previous].Enabled = False
Else
[previous].Enabled = True
End If

Many thanks
MrSiezen
You can do something like this:

If me.Recordset.absoluteposition = 0 Then
[previous].Enabled = False
End If
MrSiezen
Scott,

Me.Recordset.BOF is False if I'm at the first record. How do you use BOF for this?

Thx
dallr
Take a look at this link from Jack and see if it can suite your needs. Link 1

Dallr
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.