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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set of data available depends on category selected

Status
Not open for further replies.

sponge7

Programmer
Jul 31, 2005
5
CA
Hi,

I am having problems with cascading comboboxes (two of them, and both of them exist for each record on the form) - the first combobox doesn't allow you to "select" entries with the same ID - it lets you select the first one, but no other (yet it'll still show the other item with the same id in the combobox)... This was using a query that simply selects all of the entries and its associated ID - I used the ID to populate the second textbox appropriately.

The second combobox only shows data relevant to what was selected in the first combobox.

See below for the details of how these comboboxes are currently driven.

I am using three tables - tblTypes, tblOptions, and tblEntries. tblTypes would store the different types of entries. Each of the types in tblTypes would contain options depending on its ID.

Basically, the first combobox will list the data in tblEntries and the second combobox will list the data in tblOptions, depending on what "Entry" was selected. New "Entry's" for the first combobox would be created in tblEntries, where the ID in this table would indicate what "Options" are available for that entry. As shown in the sample table below, I want to allow more than one entry with the same "ID" (i.e. there could be more than one entry with the same options, but the entry name would be different.)

A sample of what the tables would look like is below:

tblTypes
---------
ID |Type
1 TypeA
2 TypeB
3 TypeC

tblOptions
----------
ID | Option
1 Data1
1 Data2
1 Data3
2 Data1
3 Data4
3 Data5

tblEntries
----------
ID | Entry
1 Entry1
2 Entry2
2 Entry3
3 Entry4

Below are the SQL statements used for each of the comboboxes:

cboEntries:
SELECT [tblEntries].[Entry], [tblEntries].[ID]
FROM tblEntries;

cboOptions:
SELECT [tblOptions].[Option]
FROM tblOptions
WHERE (([tblOptions].[ID])=([cboEntries]));

Any help would be much appreciated.

Thanks in advance.
 
perhaps a multiselect listbox instead of the combobox
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top