A
Afrosheen via AccessMonster.com
I have a form with cmdNext and cmdPrevious. and It works like it should. The
problem is that when the recordset is set the cmdNext button is enabled. What
I'd like it to do is disable it on the first record of the recordset. Can
this be done? This is the code I'm using now.
Private Sub Form_Current()
Dim rsClone As Recordset
10 Set rsClone = Me.RecordsetClone
20 If Me.NewRecord = True Then
30 Me!cmdNext.Enabled = False
40 Me!cmdPrevious.Enabled = True
50 ElseIf rsClone.Bookmarkable = True Then
60 rsClone.Bookmark = Me.Bookmark
70 rsClone.MovePrevious
80 cmdPrevious.Enabled = Not (rsClone.BOF)
90 rsClone.MoveNext
100 rsClone.MoveNext
140 cmdNext.Enabled = Not (rsClone.EOF)
160 rsClone.MovePrevious
170 End If
End Sub
Thanks for reading this post. I appreciate any help I can get.
problem is that when the recordset is set the cmdNext button is enabled. What
I'd like it to do is disable it on the first record of the recordset. Can
this be done? This is the code I'm using now.
Private Sub Form_Current()
Dim rsClone As Recordset
10 Set rsClone = Me.RecordsetClone
20 If Me.NewRecord = True Then
30 Me!cmdNext.Enabled = False
40 Me!cmdPrevious.Enabled = True
50 ElseIf rsClone.Bookmarkable = True Then
60 rsClone.Bookmark = Me.Bookmark
70 rsClone.MovePrevious
80 cmdPrevious.Enabled = Not (rsClone.BOF)
90 rsClone.MoveNext
100 rsClone.MoveNext
140 cmdNext.Enabled = Not (rsClone.EOF)
160 rsClone.MovePrevious
170 End If
End Sub
Thanks for reading this post. I appreciate any help I can get.