Query uses the TAB CONTROL page to filter

MonsterMaxx

Registered User.
Local time
Today, 09:44
Joined
Sep 24, 2008
Messages
15
I use a lot of Tab Controls in the interface, lots of different pages switchable by tab control

I want to have help pages on various but I don't want to have to create separate queries and forms for each when I should be able to just filter on the category.

So in a very generic example, let's say we have
/Welcome\/Items\/Orders\/Contact\

On each one of these pages is also a tab control in a subform. So
/Welcome\ would have
/Main\/Info\/Help\

activate /Items\ and you'd get
/Widgets\/Gizmos\/Help\

And so on.

My help table has category fields which would have values like Welcome, Items, Orders,Contact and so on which represent the main tab page names.

What I want to be able to do in the query that feeds the help form is filter based on the active tab. I tried
Forms![Items]![TabCtl30]
and calling the actual name of the page [Items] but neither worked.

So, the question is: how do I link information to the active TabControl?

Thanks in advance.
 
I am not sure how to do that either ... but until another suggestion comes along .. you could place an invisible control on the page and refer to it.

Oh wait .. I think those are referred to tabcontrol.page(1) ... (2) ... (3).

Check the help for that?

-dK
 
I've found that search in '03 has gotten pretty useless beyond the simple stuff.

When I put in tabcontrol.page I get a pile of results, but none of which even have "tabcontrol.page" in it.
If I put quotes around it, I get nothing.

Hunting on Google now...
 
The index is Zero-based, so the pages of a tabbed control can be referenced by using

Me.TabControlName = 0 'First page
Me.TabControlName = 1 'Second page
Me.TabControlName = 2 'Third page


and so forth, where TabControlName is replaced by the axctual name of your tabbed control. To tell when a particular page has been selected, you'd use the OnChange event, like

Code:
Private Sub TabControlName_Change()
 Select Case Me.TabControlName

  Case 0   'First page selected
      'Set query for 1st page
 
  Case 1  'Second page selected
      'Set query for 2nd page
   
  Case 2  'Third page selected
     'Set query for 3rd page 

 End Select

End Sub
 
I use a lot of Tab Controls in the interface, lots of different pages switchable by tab control

I want to have help pages on various but I don't want to have to create separate queries and forms for each when I should be able to just filter on the category.

So in a very generic example, let's say we have
/Welcome\/Items\/Orders\/Contact\

On each one of these pages is also a tab control in a subform. So
/Welcome\ would have
/Main\/Info\/Help\

activate /Items\ and you'd get
/Widgets\/Gizmos\/Help\

And so on.

My help table has category fields which would have values like Welcome, Items, Orders,Contact and so on which represent the main tab page names.

What I want to be able to do in the query that feeds the help form is filter based on the active tab. I tried
Forms![Items]![TabCtl30]
and calling the actual name of the page [Items] but neither worked.

So, the question is: how do I link information to the active TabControl?

Thanks in advance.

Your best bet is to use a Select Case based on the value of the Page Index. Put the coding for this on the On Change method.

So you'd have something like this:

Code:
Tabcontrol30_Change
  Select Case Me.tabcontrol30.value
    Case 1 'Welcome
      strSQL = "Select XXX FROM YYYY Where ZZZ"
    Case 2 'Items
       strSQL = "Select XXX FROM YYYY Where AAA"
   End Select

This is the best I can do to steer you based on your description. I hope it helps.

SHADOW
 
Sorry - I just saw that someone beat me to posting the same solution a few minutes prior to my post!

Great minds think alike :)

SHADOW
 
ahhh .. Thanks for posting final response --

Preciate that alot Linq =]

-dK
 

Users who are viewing this thread

Back
Top Bottom