Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / March 2005

Tip: Looking for answers? Try searching our database.

Make a button active only when user is on last record or form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John - 29 Mar 2005 21:25 GMT
Is it possible to know when the user is on the last record of the form and
only have a button active on that record and in active for all the other
records?

Thanks in advance
Paul B. - 29 Mar 2005 22:15 GMT
Try adding this the the Form_Current event.

You'll need to add your own command buttons, because I don't know if you can
make this code reference the record selectors on the forms and you'll have to
rename the 'FirstRecordButton' part to match your command button names.

--------------
Me.FirstRecordButton.Enabled = (Me.CurrentRecord > 1 )
Me.PreviousRecordButton.Enabled = (Me.CurrentRecord < 1)
Me.RecordsetClone.Movelast  
Me.NextRecordButton.Enabled = (Me.CurrentRecord < _
Me.RecordsetClone.RecordCount)
Me.LastRecordButton.Enabled = (Me.CurrentRecord < _
Me.RecordsetClone.RecordCount)
---------------

HTH

> Is it possible to know when the user is on the last record of the form and
> only have a button active on that record and in active for all the other
> records?
>
> Thanks in advance
Graham Mandeno - 29 Mar 2005 22:16 GMT
Hi John

Put some code in your Form_Current event procedure to compare CurrentRecord
with RecordCount:

   cmdMyButton.Enabled = Me.CurrentRecord < Me.Recordset.RecordCount

Signature

Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

> Is it possible to know when the user is on the last record of the form and
> only have a button active on that record and in active for all the other
> records?
>
> Thanks in advance
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.