Link to home
Start Free TrialLog in
Avatar of Fordraiders
FordraidersFlag for United States of America

asked on

adding additional recordset to listbox

excel 2010 vba

I have listbox i'm populating from a recordset.

I would like to also add additional items to the listbox via another recordset.


Is this possible ?

do i just need to use the same code as below to add items from the other recordset and it will add without deleting the items i have already in the litsbox ?


         Arr = rst.GetRows
       rst.MoveFirst
i = 0

With frmResultAll.ListBox1
   .Clear
        .ColumnHeads = False
        .ColumnCount = rst.Fields.Count
        .Column = Arr
        .ListIndex = -1
End With

Open in new window



Thanks
fordraiders
Avatar of Saqib Husain
Saqib Husain
Flag of Pakistan image

Unless someone comes up with a better solution you can use a loop to add individual items of the second list using the command

frmResultAll.ListBox1.add individualitem
ASKER CERTIFIED SOLUTION
Avatar of [ fanpages ]
[ fanpages ]

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of [ fanpages ]
[ fanpages ]

'Bump'! :)
Avatar of Fordraiders

ASKER

thanks
You're welcome.

I presume the suggestion resolved your issue.