The code goes in an event for the field that is changing, not on the tab. The field changes the tab.
In general events "send" information. If they received they would all have to be firing all the time.
Note also that you may have to make the other tabs invisible and bring the one you want to the top.
Tom wrote:
[Quoted Text] > Maybe getting closer. It isn't working quite right. The tab I try > it on is still visible no matter what the Department field is > showing. Also, may not be puttin g it in the right spot. Don't see > a "Change" event on the tab control. > > Working with Acces 2007 and still not comfortable finding my way > around. > > "Mike Painter" wrote: > >> If My!field = some condition then >> MyTab.Pages(2).Visible = true >> else >> MyTab.Pages(2).Visible = fales >> end if >> Tom wrote: >>> Not quite sure. How do I "Link" this to the field in question?? >>> >>> "Mike Painter" wrote: >>> >>>> Tom wrote: >>>>> I have my form with a multitude of tabbed sub forms at the bottom. >>>>> I would like to only have one tab visible, based on the data from >>>>> one field on the "Main" part of the form... >>>>> >>>>> How can I do this?? >>>>> >>>>> Thanx >>>>> Tom >>>> If only one subform is going to be visible at a time you could >>>> probably eliminate the tab control.In the Change Event of The >>>> TabControl >>>> >>>> Private Sub MyTab_Change() >>>> MyTab.Pages(2).Visible = MyTab.Page<>0 >>>> End Sub >>>> >>>> From a Pieter Wijnen and posted at eggheadcafe.comYou will also >>>> have to set the focus to that tab.
|