Dottj

On my form I have a listbox that I have linked to my suppliers table in my sql database. I want to create a second listbox (linked to another table - supplierlocations) that will pop up beside the first if a user clicks on a supplier that has more than one location/branch. Sort of like when you click on all programs on the computer and the additional programs pop up out the side to be selected.

I can create the listbox etc and bind it, I will probably use the visible property to have it appear when required, but what Im not sure about is how do I code the items (suppliers) in the first listbox (listbox1) to look through the second table (supplierlocations) and if the supplier has more than one location open the second listbox for the user to make their selection.

Thanks for any help on this, Diane



Re: Visual Basic Express Edition Pop up second listbox when certain criteria met

pinoyz

hi there!!!...you mean is when u click an item in a listbox1, the listbox2 will show the details what have u click in listbox1 example i click Supplier01(listbox1)... now the listbox2 will query to show the details of the locations of Supplier01. Am i right




Re: Visual Basic Express Edition Pop up second listbox when certain criteria met

Dottj

Not quite, sorry im not too good at explaining things.

Listbox 1 Supplier 1 (Pop up listbox only if that supplier has more than one branch) Branch 1, Branch 2

Supplier 2

Supplier 3

Need to be able to select the suppliers branch, since im doing a program for our transport company I need to be able to get to exactly the right branch that the load is being picked up from. I will be doing the same type of thing for the customers.

Diane





Re: Visual Basic Express Edition Pop up second listbox when certain criteria met

pinoyz

u mean when i select one of the list in listbox....another form apear which contains the 2nd listbox

if in the same form

if listbox2.items.count = 1 then

listbox2.visible = false

else

listbox2.visible = true

end if

 






Re: Visual Basic Express Edition Pop up second listbox when certain criteria met

Dottj

Yes, you've got it, doesn't necessarily neet to be on a seperate form, could be a panel, or just the listbox itself.

Diane





Re: Visual Basic Express Edition Pop up second listbox when certain criteria met

pinoyz

if listbox2.items.count = 1 then

listbox2.visible = false

else

listbox2.visible = true

end if