populate form tabs from table data

soulpiercing

Registered User.
Local time
Today, 06:41
Joined
Jan 5, 2003
Messages
27
I am working on my DB an have another new issue at the request of one of the users.

For user friendliness...

My office structure is for example

Main

Sub1

Sub2

Sub3

But at another staion:

Main

Sub1

Sub2

or another

Main

Sub1

Sub2

Sub3

Sub4

The user wants to be able to have a tab form to select which sub office to filter but the number of tabs will be different depending on where used. Can I populate the tabs from my "offices" table?

Or am I better off with a drop-down selection on my main screen?

I'll try to post an attachment later to help explain

Thanks
 
additional note

All of the sub office forms will be the same - only the filter criteria will change.

I think the drop down is more efficient, but the user seems to like the functionality of the tabs.

Thanks

:confused:
 
Jason,

I would stick with a combo-box on your main form.
Its recordsource would be:

Select OfficeName
From tblOffices
Order by OfficeName;

hth,
Wayne
 
Jason-
If you still wanted to play with the tab control idea here's something you might try.

(1) Create a new form.
(2) Add a tabcontrol and add pages to it until you have six pages.
(3) Set the caption for Page1 = "Main"
(4) Place the following code in the OnLoad event.
(5) Save the form, then reopen it.
Code:
Private Sub Form_Load()
Dim i As Integer
Dim namehold As String
Dim intHold As Integer

namehold = "Alpha Bravo Charlie Delta Echo Foxtrot "
intHold = InputBox("Enter a number from 1 to 5.")
For i = 2 To intHold + 1
   Me("Page" & Format(i)).Visible = True
   Me("Page" & Format(i)).Caption = Left(namehold, InStr(namehold, " ") - 1)
   namehold = Mid(namehold, InStr(namehold, " ") + 1)
Next i
For i = (intHold + 2) To 6
   Me("Page" & Format(i)).Visible = False
Next i
End Sub
Although I used a string to provide the tab captions, you could easily work out something
from a table to furnish the captions.
 

Users who are viewing this thread

Back
Top Bottom