General information
Category:
Forms & Form designer
Environment versions
Network:
Windows 2003 Server
Hi Tamar,
- the combo's row source is an array that is a property of the combo
- it's bound to a field in a cursor with the binding happening on Col 2 of the array (Col 1 is the display name)
- the array is not filled in until the form's .Init() code because I have to wait until then to get a parameter that then determines the array contents
- after populating the array, I issue .Requery() to bring the rows into the combo and then .Refresh() to get the display up to date; I had assumed the .Refresh() would have reset both .ListIndex and .ListItemID
- in this case, if I start up the form with the bound field at it's default (zero), since there is no corresponding entry in the array with that value, I would have assumed that .ListItemID would have been -1 and .ListIndex = 0; ListIndex is correct but ListItemID is a 1; the display is correct i.e. a blank row shows and if you click the down arrow on the control, it shows that no row has been chosen yet.
- I was getting incorrect results because .ListItemID was incorrect; the code now checkes both .ListItemID and .ListIndex and both have to be greater than zero - but that's only to handle the problem, should not really have to do that.
Thanks,
Albert
>
>Remind me. You're set ControlSource to the relevant field? Refreshed the combo?
>
>Tamar
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only