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 / July 2005

Tip: Looking for answers? Try searching our database.

listbox, automatically select specific item

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
natanz - 11 Jul 2005 18:27 GMT
I have a template that i use for making transmittals.  In list box "A",
i select the method, egs. fax, courier, us mail, fedex, etc.  I also
have a  list box "B" for fax number.  if "fax" is chosen for listbox
"A" then i want the fax number to appear in listbox "b", otherwise i
want it to stay blank.  In the design of my template option 1 for
listbox "b" is blank, and option 2 is the fax number.  Do these options
have generic names in VBA, so i can use the same macro for many
different templates.  I realize that the ultimate objective would be to
have all this fill in information come from an outside database, rather
than having one template for each person that i send to, but i am not
there yet.
Doug Robbins - 11 Jul 2005 19:12 GMT
Use the ListIndex property of the ListBox to determine which item is
selected.  The following is from the VBA help file:

The ListIndex property contains an index of the selected row in a list.
Values of ListIndex range from -1 to one less than the total number of rows
in a list (that is, ListCount - 1). When no rows are selected, ListIndex
returns -1. When the user selects a row in a ListBox or ComboBox, the system
sets the ListIndex value. The ListIndex value of the first row in a list is
0, the value of the second row is 1, and so on.

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

>I have a template that i use for making transmittals.  In list box "A",
> i select the method, egs. fax, courier, us mail, fedex, etc.  I also
[quoted text clipped - 7 lines]
> than having one template for each person that i send to, but i am not
> there yet.
 
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.