Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ListBox1 populates Listbox2 upon selection from a sheet?

Status
Not open for further replies.

davedave24

Programmer
Aug 26, 2010
113
GB
Hi. I have 2 listboxes, and several textboxes.

listCustomer holds the list of customers;
listRefNo holds the list of reference numbers attached to the customers;
the various textboxes hold all the data from the corresponding record in excel (date, amount and so on, not important).

Each customer may have more than 1 record/ref number attached to their name.

Excel is setup with Customers in column A, Ref No in column B, and the various pieces of data in C, D, E and so on.

When I click the customer's name in listCustomer, I need listRefNo to populate with only that selected customer's reference numbers. Then, when the user clicks one of those reference numbers, the textboxes fill with the various data from the other columns in the same row as that reference number.

I've been searching the forums for a solution but there are a lot of topics on listboxes and I'm dredging through them, so I apologise if it's been asked before and I haven't seen it.

Thanks guys.
 


hi,

Do this often.

Use MS Query to return the resultset for the selected customer. Point your second listbox to the resultset from the query.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Have a look here:
faq68-5829

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top