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 / December 2004

Tip: Looking for answers? Try searching our database.

listbox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Phil - 14 Dec 2004 06:37 GMT
in my userform I want to take information from list boxes throughout the
userform and dump the information into a main list box so it can be
organised  and then placed into a document
1 how do I set up a listbox to have 2 columns and numerous rows with heading
2 in the main listbox is it possible to have auto numbering of the entries
coming in from the other listboxes and can entries be re organised by the
user

thanks Phil
Doug Robbins - 14 Dec 2004 11:26 GMT
Still working on the same userform huh?

Really need a bit more information.  Is it only the items selected in the
other list boxes that you want to populate this new list box.  Not really
sure what you mean by "with heading 2 in the main listbox"

In what ways do you want the user to be able to re-organise the entries?

How many other list boxes are there?  Is it a fixed number?  Is it all of
the listboxes on the form or only some of them? etc.?

Signature

Please respond to the Newsgroup for the benefit of others who may be
interested.   Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP

> in my userform I want to take information from list boxes throughout the
> userform and dump the information into a main list box so it can be
[quoted text clipped - 6 lines]
>
> thanks Phil
Phil - 14 Dec 2004 11:36 GMT
hi Doug
still going new ideas keep coming up
what I'm looking to do is each multipage will have a pc sum listbox that can
be filled in then this information will go to the last page where a list of
all pc sums will appear in one listbox . at this stage the user will need to
sort the item into an order that they want either numerical or alphabetical
then this will be inserted into the document
hope this makes things clearer
cheers Phil

> Still working on the same userform huh?
>
[quoted text clipped - 24 lines]
> >
> > thanks Phil
Doug Robbins - Word MVP - 20 Dec 2004 09:55 GMT
I was in Toronto when I asked the question, but am back in Brisbane now.

I guess you mean, rather than a list box on each page a text box for the
description of the PC item and another for the amount?  If that's the case,
you could get that data to load into a list box on the final page and then
have it sorted either by PC Item or in order of the values.

In one of my projects, I achieved a similar thing by adding what, (in your
case would be the PC Items and their costs to a table in a "source"
document, and then loading them into the list box on the final page from
that source document in the way that I believe we have discussed before.

In my case, it was a list of employees and the departments to which each
employee belonged, and I used labels on the form as column headings for the
listbox.  Then I used the following couple of routines to sort the table in
the source document by the required column and then load the data back into
the list box

Private Sub lblName_Click()
'Open the TrainingData File
   Set sourcedoc = Documents.Open(PathofSystemFiles & "\TrainingData.doc",
, , False)
' Sort the list by CourseProvide then by CourseTitles
   If sourcedoc.Tables(2).Rows.Count > 2 Then
       sourcedoc.Tables(2).Sort ExcludeHeader:=True, FieldNumber:="Column
3", SortFieldType _
       :=wdSortFieldAlphanumeric, SortOrder:=wdSortOrderAscending,
FieldNumber2:="Column 3", _
        SortFieldType2:=wdSortFieldAlphanumeric,
SortOrder2:=wdSortOrderAscending
   End If
'Populate the ListEmployees listbox with the sorted data
   Call PopulateListEmployees
   ListSelectEmployee.List = ListEmployees.List
'Modify label descriptions
   lblName.Caption = "Name"
   lblDepartment.Caption = "Department (Click to sort)"

End Sub

Private Sub lblDepartment_Click()
'Open the TrainingData File
   Set sourcedoc = Documents.Open(PathofSystemFiles & "\TrainingData.doc",
, , False)
' Sort the list by CourseProvide then by CourseTitles
   If sourcedoc.Tables(2).Rows.Count > 2 Then
       sourcedoc.Tables(2).Sort ExcludeHeader:=True, FieldNumber:="Column
5", SortFieldType _
       :=wdSortFieldAlphanumeric, SortOrder:=wdSortOrderAscending,
FieldNumber2:="Column 3", _
        SortFieldType2:=wdSortFieldAlphanumeric,
SortOrder2:=wdSortOrderAscending, FieldNumber3:="Column 4", _
        SortFieldType3:=wdSortFieldAlphanumeric,
SortOrder3:=wdSortOrderAscending
   End If
'Populate the ListEmployees listbox with the sorted data
   Call PopulateListEmployees
   ListSelectEmployee.List = ListEmployees.List
'Modify label descriptions
   lblName.Caption = "Name (Click to sort)"
   lblDepartment.Caption = "Department"

End Sub

Signature

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested.  Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP

> hi Doug
> still going new ideas keep coming up
[quoted text clipped - 37 lines]
> > >
> > > thanks Phil
 
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.