previous / next record code

emartel

Registered User.
Local time
Today, 01:22
Joined
Jan 15, 2005
Messages
48
Ive added my own navigation buttons as I needed to add some code to them, but when a user gets to the first / last records & presses previous / next record, they get an error message 'cannot go to the specified record' and have to close & reopen the form.
It's prob. quite simple, but how do I get round this please?
 
There's some code in my attachment here - making smarter customised Navigation Buttons.
 
many thanks
 
SJ McAbney - Making smarter customised Navigation Buttons

SJ McAbney

I downloaded your code and imported the form into my form which is just wonderful.

I have a question on how to modify your code. I'm not all that great with VB. I didn't need the slider so I commented out

==================
'Private Sub ctlSlide_Scroll()
'DoCmd.GoToRecord acDataForm, fMain.Name, acGoTo, Me.ctlSlide.Value
'End Sub ' ctlSlide_Scroll

'Me.ctlSlide.Min = 1
'fMain.RecordsetClone.MoveLast
'Me.ctlSlide.Max = fMain.RecordsetClone.RecordCount
==================

Was I correct in doing so.

Also I do not need tha cmdNew and everything that relates to it. So how do I modify the code to remove cmdNew? I tried commenting out a few things but that just broke the whole navigation.

Thanks in advance.
 
Another thing that I noticed while using this is when you first enter the form it says 1 record not 1 of 10. But if you click on it to go to record 2 it then changes 2 of 7. Why does it only say 1 record when I first open the form?

Thanks for any help.
 

Users who are viewing this thread

Back
Top Bottom