Hi,
I have a ControlBox control on a form which has a cursor as a RowSource. So, basically, it's properties are set as follows:
.RowSourceType = 2 &&"Alias"
.RowSource = "MyCursor"
Here is how I construted 'MyCursor':
<CODE>SELECT cName, nId FROM MyTable ORDER BY cName INTO CURSOR MyCursor</CODE>
So, as you can see, I should have a 'MyCursor' with two columns, the first one with a character field (the name) and a second one with the id of the current record.
If I set the properties of my ComboBox control to:
.BoundColumn = 2
It should return the 'nID' value of the selected value. Well, it doesn't! I've done this many many times before but this time, for this one instance, the value returned is the position of the record!
Here's an example:
MyCursor:
cName nID
========|====
AAA | 2
BBB | 1
CCC | 4
DDD | 3
default | 0
If, for example, a user selects the value 'BBB' from the ControlBox, the 'Value' property of the ControlBox returns 2 instead of 1 (2 being the position in my list). If the user selects 'default', the control returns 5, etc.
I want the control to return the ID's associated with the selected record, what can I do to achieve this goal?
Thanks a million, Stephane.