Combo Box Defualt Value Changes

Started by vijbal, February 08, 2010, 09:23:10 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

vijbal

I have 5 visio pages in a document. In each of the sheets, I have a combo box with five (5) items. The items actually refer to all the pages in the visio document.  The first value in the list is the name of the page which contains the combo box. For example, Page 3 has a combo box (named cbPage3). cbPage3 has five values (Page 3, Page 1, Page 2, Page 4, Page 5) with Page 3 (the page in which the combo box resides) as default value.

When I choose an item (say, Page 4) from the combo box in Page 3, it takes me from Page 3 to Page 4. However, when I go back to the Page 3, the first value in the combo box in page 3 shows "Page 4" (the last chosen item) and Not "Page 3" (The page in which the combo box is contained.). I would like combo box in Page 3 always show "Page 3" in the default value. How would I implement this?


RedtoGreen

#1
The following VBA code might get you started.  You'll need to put it in some sort of change-event code, which runs when you change page, or use the combobox, or something like that.


cbPage3.Text = cbPage3.ContainingPage.Name


That code will change the currently displayed text in cbPage3 to the name of the page that the combobox is on.