
Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
> I have several forms on which I would like to use custom nav buttons. I have
> successfully set this up on one form but it seems like I should be able to
[quoted text clipped - 38 lines]
>
> Thanks for any help you can offer.
I must admit that I was somewhat dubious but I plugged it in and it works
well for not only the rolodex form but another form. I understand that
Call(Me) will bring over the name of the current form but typing in the
frmRolodex in the code doesn't make sense to me. Like I said it works great
even on a form not called frmRolodex but if you can point me to where I can
learn why I will develop my skills. Here is the code in the NavButtons
Module: By the way, I have learned a lot from your website in the past.
Thanks for your generosity.
Public Sub Nav(frmRolodex As Form)
Dim rsClone As Recordset
Set rsClone = frmRolodex.RecordsetClone
If frmRolodex.NewRecord = True Then
frmRolodex!cmdAdd.Enabled = False
frmRolodex!cmdNext.Enabled = False
frmRolodex!cmdPrevious.Enabled = True
frmRolodex!cmdFirst.Enabled = True
frmRolodex!cmdLast.Enabled = True
ElseIf rsClone.Bookmarkable = True Then
frmRolodex!cmdAdd.Enabled = True
rsClone.Bookmark = frmRolodex.Bookmark
rsClone.MovePrevious
frmRolodex!cmdFirst.Enabled = Not (rsClone.BOF)
frmRolodex!cmdPrevious.Enabled = Not (rsClone.BOF)
rsClone.MoveNext
rsClone.MoveNext
frmRolodex!cmdNext.Enabled = Not (rsClone.EOF)
frmRolodex!cmdLast.Enabled = Not (rsClone.EOF)
rsClone.MovePrevious
End If
rsClone.Close
End Sub
Public Sub addr()
DoCmd.GoToRecord , , acNewRec
End Sub
Public Sub FirstR()
DoCmd.GoToRecord , , acFirst
End Sub
Public Sub LastR()
DoCmd.GoToRecord , , acLast
End Sub
Public Sub NextR()
DoCmd.GoToRecord , , acNext
End Sub
Public Sub PreviousR()
DoCmd.GoToRecord , , acPrevious
End Sub
> Presumably you've got something like
>
[quoted text clipped - 60 lines]
> >
> > Thanks for any help you can offer.
Douglas J Steele - 18 Oct 2005 17:45 GMT
It's basically a coincidence that it worked!
While you may have a form named frmRolodex, that's not what frmRolodex
refers to in the Nav routine: it's a variable that represents whatever form
is passed to the routine.
I didn't mean for you to replace WhatForm in my sample. It's not critical
that you change what you have, other than to remove the chance for confusion
when you (or someone else) looks at it in the future!

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
> I must admit that I was somewhat dubious but I plugged it in and it works
> well for not only the rolodex form but another form. I understand that
[quoted text clipped - 113 lines]
> > >
> > > Thanks for any help you can offer.
SteveR - 18 Oct 2005 19:16 GMT
Thanks Doug, I also make beer and wine so I'll be checking your site. My
brother is a master at making beer.
> It's basically a coincidence that it worked!
>
[quoted text clipped - 131 lines]
> > > >
> > > > Thanks for any help you can offer.
Stephen Lebans - 18 Oct 2005 20:58 GMT
Have a look here:
http://www.lebans.com/recnavbuttons.htm
RecordNavigationButtons is an MDB containing code to replace the
standard Navigation Buttons. The custom buttons exactly emulate the standard
navigation bar including the autorepeat property

Signature
HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
>I must admit that I was somewhat dubious but I plugged it in and it works
> well for not only the rolodex form but another form. I understand that
[quoted text clipped - 120 lines]
>> >
>> > Thanks for any help you can offer.