Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / January 2006

Tip: Looking for answers? Try searching our database.

Combo Box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Weste - 26 Jan 2006 23:56 GMT
I have a 2 column combo box - column 1 is the bound column.  The combo box's
items are populated when the document is opened.  The list is populated as
shown below:

col 1       col2
1            Test
2            Test2

The column widths are 0pt;10pt (The user doesn't need to see col 1) .  When
item 1 is selected, Test is correctly displayed in the combo box .  However,
if I then save the form and then re-open it, 1 is displayed in the combo box
vs Test.  Why is this happening and what do I need to do so Test is still
displayed when the form is re-opened?  Thanks for the help.

Weste
Sam - 27 Jan 2006 13:16 GMT
I can't reproduce the problem.  What do you mean when you say you're "saving"
the form then reopening it?  Saving it in the VBE??  I've followed your specs
and the combobox displays as it should.  Is there other code that repopulates
the combobox or changes its list items/columns/formatting/etc?

> I have a 2 column combo box - column 1 is the bound column.  The combo box's
> items are populated when the document is opened.  The list is populated as
[quoted text clipped - 11 lines]
>
> Weste
Weste - 27 Jan 2006 14:14 GMT
The Word doc is named Test.doc

The following is the code

Private Sub Document_Open()
  FillComboBox
End Sub

Sub FillComboBox()

  Dim aryTest(1, 1)

  aryTest(0, 0) = 1
  aryTest(0, 1) = "Access"
  aryTest(1, 0) = 2
  aryTest(1, 1) = ".Net"

  Me.ComboBox1.List = aryTest

End Sub

When I open Test.doc I select item the first item from the combo box which
is "Access".  "Access" displays correctly in the combo box.  Then I save
Test.doc.  When I re-open Test.doc 1 displays in the combo box vs "Access".

Not sure why "Access" is no longer displaying.  Any help is greatly
appreciated.

Weste

> I can't reproduce the problem.  What do you mean when you say you're "saving"
> the form then reopening it?  Saving it in the VBE??  I've followed your specs
[quoted text clipped - 16 lines]
> >
> > Weste
Weste - 27 Jan 2006 20:26 GMT
Figured out the solution.  I need to use custom properties within Word to
save the user's selection and later retrieve it when the file is re-opened.

Weste

> The Word doc is named Test.doc
>
[quoted text clipped - 46 lines]
> > >
> > > Weste

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.