+ Reply to Thread
Results 1 to 5 of 5

Filling a listbox whith recordset data

  1. #1
    LuisM
    Guest

    Filling a listbox whith recordset data

    Hi,

    Is it possible to see records with multiple fields in a ListBox whith
    multiple columns?

    Thanks

    Luis



  2. #2
    Tom Ogilvy
    Guest

    Re: Filling a listbox whith recordset data

    yes, just set the columncount property. (listbox from the control toolbox
    toolbar)

    --
    Regards,
    Tom Ogilvy

    "LuisM" <xx0@hotmail.com> wrote in message
    news:ObDEao%23sGHA.3684@TK2MSFTNGP05.phx.gbl...
    > Hi,
    >
    > Is it possible to see records with multiple fields in a ListBox whith
    > multiple columns?
    >
    > Thanks
    >
    > Luis
    >




  3. #3
    LuisM
    Guest

    Re: Filling a listbox whith recordset data

    Thank you Tom. I need something more: some code that allows me fill column
    by column in the Listbox.

    Thanks again

    Luis

    "Tom Ogilvy" <twogilvy@msn.com> escribió en el mensaje
    news:OKWpcv$sGHA.4784@TK2MSFTNGP04.phx.gbl...
    > yes, just set the columncount property. (listbox from the control toolbox
    > toolbar)
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    > "LuisM" <xx0@hotmail.com> wrote in message
    > news:ObDEao%23sGHA.3684@TK2MSFTNGP05.phx.gbl...
    >> Hi,
    >>
    >> Is it possible to see records with multiple fields in a ListBox whith
    >> multiple columns?
    >>
    >> Thanks
    >>
    >> Luis
    >>

    >
    >




  4. #4
    Tom Ogilvy
    Guest

    Re: Filling a listbox whith recordset data

    That's the problem when you put key information in the subject and not in
    the body - it might not be seen as it wasn't seen by me.


    http://support.microsoft.com/default...61&Product=xlw
    XL2000: How to Use ADO to Return Data to a ListBox or ComboBox


    this shows a single column using additem

    after
    UserForm1.ListBox1.AddItem rstEmployees!lName
    use code like
    With userform1.Listbox1
    .AddItem rstEmployees!Name
    .List(.listcount,1) = ' the corresponding value from another column
    .List (.Listcount,2) = ' the corresponding value from a 3rd column
    End with

    You also might want to try

    Userform1.List = Application.Transpose(rstEmployees)

    in xl2000 and earlier, application.Transpose only works with an array of
    5461 elements.

    --
    Regards,
    Tom Ogilvy


    "LuisM" <xx0@hotmail.com> wrote in message
    news:u8Ca2iDtGHA.2376@TK2MSFTNGP04.phx.gbl...
    > Thank you Tom. I need something more: some code that allows me fill column
    > by column in the Listbox.
    >
    > Thanks again
    >
    > Luis
    >
    > "Tom Ogilvy" <twogilvy@msn.com> escribió en el mensaje
    > news:OKWpcv$sGHA.4784@TK2MSFTNGP04.phx.gbl...
    >> yes, just set the columncount property. (listbox from the control
    >> toolbox toolbar)
    >>
    >> --
    >> Regards,
    >> Tom Ogilvy
    >>
    >> "LuisM" <xx0@hotmail.com> wrote in message
    >> news:ObDEao%23sGHA.3684@TK2MSFTNGP05.phx.gbl...
    >>> Hi,
    >>>
    >>> Is it possible to see records with multiple fields in a ListBox whith
    >>> multiple columns?
    >>>
    >>> Thanks
    >>>
    >>> Luis
    >>>

    >>
    >>

    >
    >




  5. #5
    LuisM
    Guest

    Re: Filling a listbox whith recordset data

    Tom, thank you. The code that you suggested me worked fine. The Transpose
    property seems not to be recongnized by the application.

    Regards

    Luis

    "Tom Ogilvy" <twogilvy@msn.com> escribió en el mensaje
    news:%23BLvo$DtGHA.4596@TK2MSFTNGP04.phx.gbl...
    > That's the problem when you put key information in the subject and not in
    > the body - it might not be seen as it wasn't seen by me.
    >
    >
    > http://support.microsoft.com/default...61&Product=xlw
    > XL2000: How to Use ADO to Return Data to a ListBox or ComboBox
    >
    >
    > this shows a single column using additem
    >
    > after
    > UserForm1.ListBox1.AddItem rstEmployees!lName
    > use code like
    > With userform1.Listbox1
    > .AddItem rstEmployees!Name
    > .List(.listcount,1) = ' the corresponding value from another column
    > .List (.Listcount,2) = ' the corresponding value from a 3rd column
    > End with
    >
    > You also might want to try
    >
    > Userform1.List = Application.Transpose(rstEmployees)
    >
    > in xl2000 and earlier, application.Transpose only works with an array of
    > 5461 elements.
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "LuisM" <xx0@hotmail.com> wrote in message
    > news:u8Ca2iDtGHA.2376@TK2MSFTNGP04.phx.gbl...
    >> Thank you Tom. I need something more: some code that allows me fill
    >> column by column in the Listbox.
    >>
    >> Thanks again
    >>
    >> Luis
    >>
    >> "Tom Ogilvy" <twogilvy@msn.com> escribió en el mensaje
    >> news:OKWpcv$sGHA.4784@TK2MSFTNGP04.phx.gbl...
    >>> yes, just set the columncount property. (listbox from the control
    >>> toolbox toolbar)
    >>>
    >>> --
    >>> Regards,
    >>> Tom Ogilvy
    >>>
    >>> "LuisM" <xx0@hotmail.com> wrote in message
    >>> news:ObDEao%23sGHA.3684@TK2MSFTNGP05.phx.gbl...
    >>>> Hi,
    >>>>
    >>>> Is it possible to see records with multiple fields in a ListBox whith
    >>>> multiple columns?
    >>>>
    >>>> Thanks
    >>>>
    >>>> Luis
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1