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 / November 2006

Tip: Looking for answers? Try searching our database.

Multichoice List box query

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Al@n - 19 Nov 2006 18:01 GMT
box (lstProtect) of which is multichoice. Depending on which basic
descriptions are chosen in the list box i.e. Ducts, Freeformat etc, I wish a
more elaborate description of the choice inserted in a textbox(txtProtect),
based on a case statement of the list index of the list box.(only two
choices so far but more to be added.)

With the help of this forum, I've been able to put the lstProtect choices in
the text box but not the more elaborate descriptions.

Code so far is as below.

Private Sub lstProtect_Change()
Dim Workstring

Dim Userchoice As Long
Userchoice = lstProtect.ListIndex
Select Case Userchoice
   Case 0
       txtProtect.Text = "It will be necessary for you to install ***
number spare ducts.(Please refer to ""STORES"" section Specific Conditions)"
   Case 1
       txtProtect.Text = "Please replace this text with your own"
End Select

' Set Workstring empty
     Workstring = ""
     ' Items are indexed from zero
     ' Loop through all the items..
     For i = 0 To lstProtect.ListCount - 1
     n = i + 1
           '..and check whether each is selected
           If lstProtect.Selected(i) Then
                 Workstring = Workstring & lstProtect.List(i) & "." &
Chr(10)
           End If
     Next i
      txtProtect.Value = Workstring

End Sub

I would be grateful for any assistance in achieving my goal above.

TIA

Signature

Al@n

--
Al@n

Doug Robbins - Word MVP - 20 Nov 2006 04:15 GMT
See response to your later post.

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

> box (lstProtect) of which is multichoice. Depending on which basic
> descriptions are chosen in the list box i.e. Ducts, Freeformat etc, I wish
[quoted text clipped - 40 lines]
>
> TIA
 
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.