listbox population

kostello

New member
Local time
Today, 06:00
Joined
Sep 3, 2008
Messages
1
Hello all

My problem is the following: (i use ms access)

I have a table named ProductCategories and many other tables named Coffees, soft drinks, juices, Alcohol, etc etc
The ProductCategories table contains the following values: coffees, soft drinks, juices etc,etc.
As you understand each value of the ProductCategories table is a seperate table itself. The coffees tables contains: espresso, filter coffee, etc
The soft drinks table contains: coca cola, orange juice, lemonade etc.

Now, i have 2 listboxes. Listbox1 is populated with the data of the ProductCategories table. (coffees, juices, alcohol etc).
So far ok.
I want listbox2 to be populated with the data of each other product table.
for example. I want to click on the coffee item in listbox1 and automatically the listbox2 to get populated with the data from the table "coffees".

Or differently, when i select an item from listbox1, by clicking a button to populate listbox2 with the values from the relative product table.

I know i must use the selecteditem methos but it gives me error.
I ve searched the whole net but i cant find any helpful sites.

Normally the pseudocode has to be like this:
If listbox1.selecteditem = "coffees" then
populate listbox2 with values from "coffees" table.

I also know it can be done using, the case method.

Any help would be much appreciated.
 
but, it will be difficult having separate tables for coffees, soft drinks, juices

what you really need is a single product table - although there might be some fields in it that are blank or not relevant for some types of product, and allocate these items within the table to the various product groups.

that way, the prodiuct combo boxes only point to the products table, which is far easier to manage them haviing to change the table for each product group

Your way, you would have major problems everytime you decided to have a new product group eg icecreams, cakes etc,
 

Users who are viewing this thread

Back
Top Bottom