开发者

Using a MS Access Tab Control for Navigation

开发者 https://www.devze.com 2023-01-22 03:28 出处:网络
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 开发者_开发百科

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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号