Full Version: Combo Box shows some data and not others why?
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
Aazzner
I have a database that I am storing part numbers in.
In my form the part number is the index field for my combo box, and the display information is the part number - part description. (part:[part_num] & " - " & [part_desc]

The part number is a text field due to - alpha characters in it.

Problem is some parts show up with part - descr others it is blank.

Any clues why??

Aazzner
schroep
Try this to see if it fixes the problem:

part:NZ([part_num],"") & " - " & NZ([part_desc],"")

Assuming there are values in your table for part_num and part_desc, you shouldn't get blanks (at the very least, you should get a hyphen).

Also, check your query to make sure it isn't exluding any rows you expect returned.
Aazzner
Thank you Peter.

I have a couple of examples

part_num part_desc
11210591-12 TUBE W/ONE MOLDED E/F
02164901 CARRIER
02168101 CONDUIT BULK / CUT LENGTH
11230536 BODY SUB ASSEMBLY

They should come out looking like the following

11210591-12 - TUBE W/ONE MOLDED E/F
02164901 - CARRIER
02168101 - CONDUIT BULK / CUT LENGTH
11230536 - BODY SUB ASSEMBLY

And in the table I have the Part_Number field set as a look up to pull it this way and it works.
But in the form, these values don't appear.
You can type in the part number and it shows up, but when you tab on to the next control it disappears.
I can't figure out why.

The NZ() only works if there is possibly a null value there correct?

Aazzner
schroep
It sounds like the problem is not in your query, but in the formatting of your combo box.

Likely, your combo box has a query underlying it that is returning more than one column.

The important properties to check in your combo box are:

COLUMN COUNT
COLUMN WIDTHS
BOUND COLUMN

You want to bind your combo box to column 1, set your column count to 2, and your column widths to something like 0";2".

Also, note that LOOKUPS in a table (as you mentioned) are considered bad form. They just cause problems. Tables hold data, forms are for data entry.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.