Hi,
I have a form that consists of several combo boxes displaying information from a table. The table has ID fields, but I would like to display descriptions (from lookup tables) instead. The way I see it, there are 2 parts to this: the combo box 'text' part that will display the description of the ID actually on the table, AND the drop-down list that will display all the descriptions, from the look-up table.
From reading posts here, I have come up with a way to do this, but I'd like to make sure that this is the 'right' way and not kludgy. Here's how I do each combo box (by the way, form's record source is a query I have set up):
Combo box's control source is the corresponding ID on my table/query. Row source is the following select statement, referencing corresponding lookup table:
There are 3 columns, and their widths are: .007;0;2. The bound column is the ID, column 2.
Is it correct to use 3 columns like this? I tried it a handful of other ways, but had problems.
In addition, I have another question. One of my combo boxes will list descriptions based on the value selected in another combo box. For example, if combo box 1 selection is Furniture, combo box 2 will display "Dresser, Bed, Couch, etc". I haven't gotten this part to work so great yet - it works only for the first value, but when the values down the form change, cbo value is blank.
Its SQL is:
In my module, I requery subcategory on Category After_update (I tried Before_Update and Change, too). It only displays correctly for the first value of Category down the page. When category changes, the value in the 'text' portion of subcategory is blank, although its drop-down list is correct. I have narrowed the problem down to my WHERE clause; without it, it works fine. How do I have SQL display the the description for an item's ID, and then separately have the drop-down list correspond to another code?
I would appreciate any help on knowing if I am doing this correctly with the 3 columns, plus having one cbo dependent on another.
Thanks in advance.
I have a form that consists of several combo boxes displaying information from a table. The table has ID fields, but I would like to display descriptions (from lookup tables) instead. The way I see it, there are 2 parts to this: the combo box 'text' part that will display the description of the ID actually on the table, AND the drop-down list that will display all the descriptions, from the look-up table.
From reading posts here, I have come up with a way to do this, but I'd like to make sure that this is the 'right' way and not kludgy. Here's how I do each combo box (by the way, form's record source is a query I have set up):
Combo box's control source is the corresponding ID on my table/query. Row source is the following select statement, referencing corresponding lookup table:
Code:
SELECT tlkpItemCategory.ItemCategoryDesc, tlkpItemCategory.ItemCategoryID, tlkpItemCategory.ItemCategoryDesc
FROM tlkpItemCategory
ORDER BY tlkpItemCategory.ItemCategoryDesc;
Is it correct to use 3 columns like this? I tried it a handful of other ways, but had problems.
In addition, I have another question. One of my combo boxes will list descriptions based on the value selected in another combo box. For example, if combo box 1 selection is Furniture, combo box 2 will display "Dresser, Bed, Couch, etc". I haven't gotten this part to work so great yet - it works only for the first value, but when the values down the form change, cbo value is blank.
Its SQL is:
Code:
SELECT tlkpItemSubcategory.ItemSubcatDesc, tlkpItemSubcategory.ItemSubcatID, tlkpItemSubcategory.ItemSubcatDesc
FROM tlkpItemSubcategory
WHERE (((tlkpItemSubcategory.ItemCategoryID)=[Forms]![frmItems]![cboItemCategory].[Value]))
ORDER BY tlkpItemSubcategory.ItemSubcatDesc;
I would appreciate any help on knowing if I am doing this correctly with the 3 columns, plus having one cbo dependent on another.
Thanks in advance.