views:

14

answers:

1

I'm scratching my head whether this idea is worth exploring:

I'd like to use a tab control to filter a subform field by the value of the tab control page. There are about 5 different values for that field, so it would be neat to have 5 tabs where you click on the tab and see the list of just those matching records.

I'm a bit of an Access 2007 neophyte (haven't designed a DB with Access in years), so these are the problems that need to be solved with this approach.

  1. Is it possible to have the same subform show on every Tab control page?
  2. What's the most efficient way to link the value of the tab to the subform query?

I realize the brain-dead way to do this is simply create a separate subform for each page, but this seems rather inefficient. Or is it?

+1  A: 

If you're filtering the same data, you don't need five copies of the subform, you just need to trigger a change of the Recordsource of the subform or apply a filter to it.

There are two approaches I'd consider:

  1. use a tab, but use it just as a tab strip, with the subform not embedded on any page of the form, but below it. In the tab's OnChange event, filter the subform appropriately.

  2. use an option group with toggle buttons and in the AfterUpdate event, filter the subform. This will look just like the tab control with the Style property set to Buttons.

David-W-Fenton