Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1149
  • Last Modified:

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?
0
ramrom
Asked:
ramrom
  • 6
  • 3
1 Solution
 
Dale FyeCommented:
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

0
 
ramromconsultant Author Commented:
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.
0
 
peter57rCommented:
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.
0
Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 
Dale FyeCommented:
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.
0
 
ramromconsultant Author Commented:
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.
0
 
ramromconsultant Author Commented:
NavBtn.SetFocus
SendKeys "~"
0
 
ramromconsultant Author Commented:
Answered my own question.
0
 
Dale FyeCommented:
Strongly recommend against using SendKeys.
0
 
ramromconsultant Author Commented:
Why? And what alternative is there?
0
 
ramromconsultant Author Commented:
docmd.browseto also does the trick, except the first time I call it it must be called twice!
1

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 6
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now