Link to home
Start Free TrialLog in
Avatar of ramrom
ramromFlag for United States of America

asked on

How do I programatically activate a navigation button on an access 2010 navigation control?

How do I programatically activate a navigation button on an access 2010 navigation control?
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

Well, you cannot "activate a navigation button", but you can use the docmd.gotorecord method

Syntax looks like:

docmd.GoToRecord ,, acfirst

and the parameters are acFirst, acPrevious, acNext, acLast, acNew

or if you wanted to move backwards 3 records you could use

docmd.gotorecord ,,, -3

Avatar of ramrom

ASKER

Not a relevant answer. I refer specifically to the Navigation Control as found (e.g.) on the Navigation Form - see http://msdn.microsoft.com/en-us/library/ff851947.aspx?ppud=4.

This is a series of buttons each of which can be associated with a form or report. No direct relationship to moving between records. I plan to have a form under NavigationButton1; a user action on that form should switch to the form under NavigationButton2.
Unfortunately we now have Navigation Forms and Navigation Controls (and Navigation Panels) and this is leading to plenty of confusion.

The poster wants to know about command button controls on Navigation Forms, despite what his original post stated.


I haven't had reason to do it but I would have thought you would use

 me.NavigationButtonName.Click

or maybe
me.Parent.NavigationButtonName.Click

or maybe
Forms!Navigationformname!NavigationButtonName.Click

depending on where you are calling it from.
Although I have 2010 loaded on my laptop, for testing purposes, have not really played around with the new interface.  Why can't MS stop screwing with the GUI, now that I'm comfortable with the ribbon, they seem to have moved on to something else.
Avatar of ramrom

ASKER

Thanks for reading & thinking about my question.
Please no more flames or guesses or incorrect corrections. MS calls it a NavigationButton. See Help (as well as properties or object browser):
"NavigationButton Members ... This object represents a navigation button in a navigation control on a form.
ASKER CERTIFIED SOLUTION
Avatar of ramrom
ramrom
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ramrom

ASKER

Answered my own question.
Strongly recommend against using SendKeys.
Avatar of ramrom

ASKER

Why? And what alternative is there?
Avatar of ramrom

ASKER

docmd.browseto also does the trick, except the first time I call it it must be called twice!