Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tab Control Runtime Modification

Status
Not open for further replies.

Ataraxia

Programmer
Jul 1, 2003
3
GB
Hi
Ok here goes...
I have a form which Displays data for a Regional office (there are several of these offices - each represented by it's own instance of the form).
This form contains a tab control.
Page one of the tab control shows general data for the regional office. Any other pages in the tab control each display a different department's (within the office) information.
The department make-up varies for each regional office both in number and type.

I have discovered that Access 2000 cannot add or delete pages to a tab control at runtime but you can play with the visible property of tabs. So, what I have done is added the max number of possible departments for a regional office (a nice rounded 10).

Any tips on the best way to: 1, identify the names and number of an office's departments* 2, Name and make visible the pages required, 3, populate the department data on each page. Presumably this code could be run when the form opens but how about using the navigation buttons to move from one regional office to another?

Many thanks - apologies for the lengthy description.

A

*The table relationship of Office--Department is a one to many
 
get rid of the tabs and create two listboxes on the left side of your form, and a subform on the right. you can use the listbox to navigate to each department (where the listbox does support adding/removing items at runtime), setting the first list's rowsource to your table of offices, and the second to a parameter query who's office parameter is fed by the selection of an office from the first. the user would pick an office from list one, a department from list two, and the subform could be dynamically sourced (either in terms of data or the entire source form, depending on whether the feilds and formatting are constant from department to department). to show general data for the overall office, create a form for general data and set this form as the sourceobject of the subform when the user has a selection in list one, but not list two (If lstListTwo = 0 Then... kind of syntax). This lets you dynamically control the number of possible departments based on how many there actually are in each department rather than relying on some arbitrary and potentially overly-restrictive number of tabs, and to get rid of the tabs themseleves, as forms with a large number of tabs tend to be among the least friendly user interfaces one could construct (see some human factors or user interface design websites on the matter). if you don't want the first list (i.e. each user can only see their own department) you can get rid of it and add a fixed value to the parameter query (or handle it with code that picks up an "office" value entered by the user earlier in their navigation of your application).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top