Form navigaion button help

raydan

Registered User.
Local time
Today, 10:41
Joined
Aug 24, 2005
Messages
28
I have a form where I set the record Nav and Record set to NO and placed buttons on the form to navigate through the records in the form from the tables. I would like for the next record and previous record buttons to have the pop-up say "you have reached the final record", not you can not go the the specified record. It just sounds a bit confusing for some people.

Thanks in advance!

Scott
 
Can't you trap the error and supply your own instead?
 
I dont know how to trap an error. It is the default error for the end of records in a DB, I think. This is the pop-up "you can not go the the specified record".
 
Don't you have VBA code behind your buttons?
To trap an error use the ON ERROR code (use help).
 
The error msg is generated by code that access creates. I guess you added the buttons through the wizard. You need to study the code and the different events that are available.

I use the following code (provided by Mile-O-Phile) on the Form_Current event to disable the buttons at each end of the record set. Try it, just substitute you cmdbutton name as required.

Me.RecordsetClone.MoveLast

Me.cmdPrevious.Enabled = Me.CurrentRecord > 1
Me.cmdNext.Enabled = Me.RecordsetClone.RecordCount > Me.CurrentRecord

The part of the code after the = is evaluated as a mathimatical equation, thus making a true or false

Dave
 

Users who are viewing this thread

Back
Top Bottom