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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ComboBox (Duplicate and Synchronize)

Status
Not open for further replies.

robctech

IS-IT--Management
Oct 12, 2001
114
0
0
CA
Ok probably a dumb question. But I have a form with 3 individual tabs on it. I have a combobox control array.

What I want is to add the items to the combobox on the first tab then duplicate it across the other three. This way they are all the same. This way it doesn't matter which combo box they select from I can synchronize the data accross all 3 tabs. tried a simple combobox(1) = combobox(0) but doesn't work...any suggestions?

thnks in advance
 
Do you mean an SSTab control? If so, SSTab moves controls in and out of the visible tab by setting its ".Left" position to something like -73800 (depends on your screen resolution.) You can make the same combo (or whatever) appear on every tab with something like:
Code:
Private Sub SSTab1_Click(PreviousTab As Integer)
    Combo1.Left = 1200
End Sub
That way you need only one combo box rather than trying to sync as many as you have tabs.
 
Are you trying to do something like,

Code:
Combo1(0).listindex = Combo1(1).Listindex

Or do you want the list items in each to reflect the addition of a list item to any? If that is the case you may have to add the new item manually. Perhaps something like this,

Code:
 Combo1(1).additem Combo1(0).list(combo1(0).newindex)
Combo1(2).additem Combo1(0).list(combo1(0).newindex)

If I have missed the mark please explain again.

Take Care,

zemp

"Show me someone with both feet on the ground and I will show you someone who can't put their pants on."
 
zemp you are pretty much correct. Basically what I am doing is I have a 3 combo boxes that are populated by records from a database (disconnected). I want to issue
combo(0).additem "the value"

then when done populate the other 2 with the same data without having to add to the code as follows

combo(0).additem "the value"
combo(1).additem "the value"
combo(2).additem "the value"

etc etc...does that make more sense...and I am using the sstab but can not figure how to get the combo to move from tab to tab
 
Sounds like you want the combobox to sort of float over the tabs. So that you see the same combobox regardless of which tab you are on. If so, place the combo box on the form and in the form load event place it and set its zorder. something like,

Code:
combo1.top=sstab1.top+480
combo1.left=sstab1.left+480
combo1.zorder 0

Then your combo box never actually moves or switched tabs. It just kind of floats above the tabs. The user won't the difference.

Take Care,

zemp

"Show me someone with both feet on the ground and I will show you someone who can't put their pants on."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top