Hi, everyone! How do I make a button "Previous" disappear upon the beginning of the recordset and button "Next" disappear upon the end of that recordset in Access 2010? Thanks so much for your help!
Hi, everyone! How do I make a button "Previous" disappear upon the beginning of the recordset and button "Next" disappear upon the end of that recordset in Access 2010? Thanks so much for your help!
Are they *your* buttons or the ones on the NavigationBar at the bottom of a form?
That is little chance you can modify that control but you could modify your own nav control: http://www.lebans.com/recnavbuttons.htm
Hello,
You may try the following, kindly test at your end
Command9 - Previous Button
Command12 - Next Button
We are assuming that the Forms Navigation property is set to No
Private Sub Command9_Click()
DoCmd.GoToRecord acDataForm, Me.Name, acPrevious
Me.RecordsetClone.Bookmark = Me.Bookmark
Me.RecordsetClone.MovePrevious
If Me.RecordsetClone.BOF = True Then
Me.Controls("command12").SetFocus
Me.Controls("command9").Visible = False
End If
Me.Controls("command12").Visible = True
End Sub
Private Sub Command12_Click()
DoCmd.GoToRecord acDataForm, Me.Name, acNext
Me.RecordsetClone.Bookmark = Me.Bookmark
Me.RecordsetClone.MoveNext
If Me.RecordsetClone.EOF = True Then
Me.Controls("command9").SetFocus
Me.Controls("command12").Visible = False
End If
Me.Controls("command9").Visible = True
End Sub
Private Sub Form_Open(Cancel As Integer)
Me.Controls("command9").Visible = False
End Sub
Rgds