Aug 24 2006, 03:37 PM
Hey there! I have had this problem so many times, and I am hoping to get to the bottom of it, because I bet there is something very simple to fix it.
I have a listbox on my form, it has 2 columns, [Item Name], and [Category], both from an "Inventory" table. The [Category] column in the Inventory table, however, is actually a lookup to a "Category" table...
Now in my listbox in the category column, instead of saying "Tools" or "Consumables" for example, it instead shows "5" or "8", which is the Category ID number.... How do I make it say the category name instead of the category ID? I'm sure you will need more info, but I'm not sure what. heeeelp!
Aug 24 2006, 03:45 PM
Change the column widths in the list box so that the first column width is 0.
Or you may need to flip flop the columns if the CategoryName is the first column.
Aug 24 2006, 03:54 PM
The first column has a width of 0 already, the first column is the inventory ID (INVID) number. So I guess there are 3 columns in the listbox, INVID, Item Name, and Category. My problem is not that the CATID (Category ID) is visible, its that the Category column should say the category name, and not the CATID.
on a side note, the problem I think is that I used a lookup at the table level, and I am told that is bad... but I don't really know any other way to assign a category to an item.
Edited by: Praryboy on Thu Aug 24 17:01:33 EDT 2006.
Aug 24 2006, 04:37 PM
What you want to do is create a query in the query builder using the Inventory and Category Table. Drag three fields into the query, INVID and [Item Name] from the inventory table and [Category Name] from the category table (I'm guessing at the Category Name field, you will have to change this to whatever it is. Make sure you drag the fields in that order. Save the query.
Then in the form's design view, in the listbox's rowsource property, type in the name of the query you just saved. The query should take care of the lookup for you.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here