Is there a way to allow the user to use the navigation buttons, but not allow them to move beyond the last record?
I have been trying to code it in VB but have not figured out a way to do this yet. Any help on this would be appreciated!!!
This is a bit more complex but greys out the button if you cant move
It involves 3 buttons New Next and Previos
Create the buttons as normal
Then the Code with your field and form names
!My stuffs in Blue
'======================================================================
'records movement buttons stuff
'-------------------------------------------------------------------------
Set recClone = Me.RecordsetClone()
blnNew = IsNull(Me!Stay_ID) 'If a new record then the next button is disabled
Me!Owner_ID.Value = Forms!owners2!Owner_ID.Value
CmdNext.Enabled = False
CmdPrevious.Enabled = True
End If
[CmdNew].Enabled = True
If recClone.RecordCount = 0 Then 'If there are no records then the next and previous buttons are disabled
CmdNext.Enabled = False
CmdPrevious.Enabled = False
Else
recClone.Bookmark = Me.Bookmark
recClone.MovePrevious
CmdPrevious.Enabled = Not (recClone.BOF) 'previous button disabled if first record
recClone.MoveNext 'Two move nexts, one to get back to current, one to go ahead.
recClone.MoveNext
CmdNext.Enabled = Not (recClone.EOF) 'next button disabled if last record
recClone.MovePrevious
End If
recClone.Close
RefreshDatabaseWindow
Copy and paste the above code into the OnCurrent event. Dont forget to change my field names with yours
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.