I'm having trouble trying to show codes and their descriptions (two fields) in the drop-down of a ComboBox. The code is the one I want stored. For the record, I'm using 3.1.1 and XP SP3.

When I set up the definition as
ITEMSOURCE UCATHL->ATHLCD
everything compiles and runs perfectly, but (obviously) shows only the code.

When I change the definition to
ITEMSOURCE UCATHL->ATHLCD, UCATHL->ATHLNAME
it compiles, but then I get the following run-time error:

Program Error
Error BASE/1108 Argument error: AT
Called from AT(0)
Called from DEFINECOMBO(161)
Called from...

(Using "ITEMSOURCE UCATHL->ATHLNAME" on its own works fine, so it's a valid field.)

I've used the Combo.8 and Combo.9 samples, and they compile OK, but they don't show the codes (the first field listed) -- only the descriptions (the 2nd field listed), and no menu!, so I'm not sure what, if anything, that tells me!

Sample program is attached. It's very small -- just a few lines to open the table, index it, then load and activate the window, which has only the ComboBox in it -- but it gives me the same error; it just doesn't seem to like two fields in ItemSource!!

Was it something that used to work but the feature has been taken away? Or is there some other thing that's causing it to not work? I don't know, so I'm still confused!

It certainly seems like the intention is (or was?) to have a dropdown box with 2 columns, such as a code and a full-text name for the code (with only the code being stored), as in the sample and in what I was trying to do. It would definitely be a useful thing to have and to get working!

Tks.
CalScot

PS: Also...

I think that the possibility of having the two fields in ITEMSOURCE is why the DROPDOWNWIDTH option exists: That width would need to be greater than the width of just the data in the box itself.
Sorry, but so many things point to saying that is -should- work, so I don't want to give up yet!

...
Was it something that used to work but the feature has been taken away? Or is there some other thing that's causing it to not work? I don't know, so I'm still confused!

You are write, by a quick read HMG Doc and and COMBO.8 sample, its seem that its possible to define two field as ITEMSOURCE.

But as notified a little down of this doc page, at "Image Support" section, this two field notation is for Image support; not for automatically concatenate two fields nor for make a two column combobox.

In fact, with this way its possible build a two column ComboBox; but first column is for images.

It certainly seems like the intention is (or was?) to have a dropdown box with 2 columns, such as a code and a full-text name for the code (with only the code being stored), as in the sample and in what I was trying to do. It would definitely be a useful thing to have and to get working!

Thanks to the replies by Marek & esgici, I have a solution. (Updated sample attached.)

The dropdown list shows the concatenated code and description fields, but only the code field shows in the box. When the data is saved, the field it is saved to is the same length as the code, so the data gets truncated, only the code is saved, and the description data is discarded.

It does mean using a different, fixed-width font, but it works. ( I wish that there was a fixed-width version of Arial !! )