Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Navigate to a specific tab in Access 2010

Posted on 2011-03-24
17
Medium Priority
?
2,059 Views
Last Modified: 2013-11-28
Is there some other way other than the Browseto command to navigate to a specific tab.  The problem I have with using browseto is that I am trying to use a generic form on multiple tabs and using the form name as the target just picks the first occurence of it.  



DoCmd.BrowseTo acBrowseToForm, "ContractorGeneric", "main.navigationsubform"

Open in new window

0
Comment
Question by:Kilmiester
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 6
  • 2
  • +1
17 Comments
 
LVL 85
ID: 35211194
Is this a Web database?
0
 

Author Comment

by:Kilmiester
ID: 35212004
No, It is not.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 35215882
.BrowseTo will only navigate to a specific Form or Subform, it can't navigate to a specifc Tab on a tabbed control on a form.
(Please see the VBA help files on .BrowseTo)

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 35216090
Do you have to use .BrowseTo?
You can do this with OpenForm, just as well...

In any event you can do what you are asking in a roundabout way...

Put this in a module:
    Public strpubBrowseToSpec As Boolean

Put this on your code to open (Browse To) the form:
    strpubBrowseToSpec = True
    DoCmd.BrowseTo acForm, "frmTest"

Put this on the Open Event of the form to be opened:
    If strpubBrowseToSpec <> False Then
        Me.Page8.SetFocus
        strpubBrowseToSpec = False
    End If


JeffCoachman




0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 35216253
It is not clear from your post or code snippet if you are referring to a "Page" or a "Tab", or even what objects you are dealing with here.

This may all be a moot point as a "Page" in the .BrowseTo method is specified for "Web Only"
...and you have stated above that this is not a Web Database...

(Many people call a Tab a Page an vice versa, so you really have to select the Object/Control, then look at the top of the property box and note the "Selection Type", ...

In other words can you clearly state *exactly* what you have here and what you are trying to accomplish?

thanks

JeffCoachman

0
 

Author Comment

by:Kilmiester
ID: 35216530
Since I posted yesterday I have scrapped my original layout so this isn't an issue for me at the moment. However I would still like to know a better way than browseto.  Want I want to know is there a way to activate a specific navigation tab control so that it will display it's target page.  
The command does work on a non web-enabled access database, but since it searches for the target page, instead of a control, I have already found other issues with it and would like to know a better way.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 35217262
"activate a specific navigation tab control so that it will display it's navigation tab control "
Again, please state in detail want you are type of Objects you are referring to here You have referred to a "navigation tab control " being in a "navigation tab control ...?
0
 
LVL 31

Expert Comment

by:Helen Feddema
ID: 35222528
If you are referring to a tab (page) on a Tab control, this syntax works:

Me![pgeCompQuotes].SetFocus
0
 
LVL 31

Expert Comment

by:Helen Feddema
ID: 35222537
If not, please be very specific about exactly what type of control you are referring to.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 35223741
<would like to know a better way.>

This is what I posted in http:#a35216090

Helen also in http:#a35222537
0
 

Author Comment

by:Kilmiester
ID: 35262527
I have tried using setfocus, but it would not work either.  None of the commands below work. I changed the flow of my form to get around this for now.

Using setfocus it does set the focus to that tab control, but it doesn't activate the tab or switch the target form in the navigation control.  

Using browseto seems to accomplish nothing.

DoCmd.BrowseTo acBrowseToForm, "Overview", Form_Projects.NavigationSubform
DoCmd.BrowseTo acBrowseToForm, "Overview", "Form.main.navigationsubform >Projects.NavigationSubform"
Form_Projects.NavigationControl0.Controls(0).SetFocus
Form_Projects.NavigationButton7.SetFocus

Open in new window

0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 35263361
Again, if this is not a "Web Database", why are you using BrowseTo at all?

What Helen and I posted has worked fine for me for years to select a specific tab on a Tabbed form...

here is a sample:


Database8.accdb
0
 

Author Comment

by:Kilmiester
ID: 35263761
I'm sorry I never actually specified that I'm using a navigation control. Not a tab control.  This is my first project I am doing with Access 2010, but yes,in  your example accdb is the way I would expect the navigation control to act.
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 1500 total points
ID: 35264938
Oh...

The Nav Control is OK if you want something quick and dirty.

If you want a bit more flexibility and control, use code and objects like Helen and I suggested.

;-)
Jeff
0
 

Author Comment

by:Kilmiester
ID: 35298618
Ahh so the solution is that Navigation tabs are bad. lol.  My first time using Access 2010 to write an application and I wanted to use a combination of horizontal and vertical tabs so I'll just rotate my layout again so tab control for the top tabs, and navigation control for the verticals.
0
 

Author Closing Comment

by:Kilmiester
ID: 35298670
Wasn't an actual solution to my problem, but rather a suggestion to use another method.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 35298798
<Ahh so the solution is that Navigation tabs are bad. lol.  My first time using Access 2010 to write an application and I wanted to use a combination of horizontal and vertical tabs so I'll just rotate my layout again so tab control for the top tabs, and navigation control for the verticals.>
No not bad, but they don't provide mush beyond being easy to create and looking cool.

Remember developers have been designing great looking Main Menus for "Decades", before navigation Controls came along...

When you make your own interfaces from scratch, you can do anything you want...

The main thing is to make sure the application is fully normalized and functioning, the "Navigation" should come last...

;-)

JeffCoachman
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question