Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo field reverts to old value when focus returns to i
Message
From
04/08/1999 22:01:29
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00249541
Message ID:
00250038
Views:
24
>David,
>
>What is the controlsource for the combo?

Judging by the other responses, the controlsource is a likely source of the problem.

Currently, controlsource is set to None and BoundTo is .F. I want to be able to either enter a value to set a record or select it from the list. My first try was to create a form property to use as the controlsource, but this did not get the exact behavior I wanted for the control.

For one thing, the select value from the rowsource is not necessarily unique although it is very rare for it to be duplicated (Don't blame me, its a business rule). Rare enough so that it's reasonable to warn the user when a duplicate has been selected and then let the user bump through the combolist to pickup the right one using other displayed fields to determine uniqueness.

When I tried using an explicit controlsource, VFP would only allow me to select the first (in current sort order) occurance of a record containing a duplicate key. If I select a second or third occurance, VFP forces the list pointer back to the first.

To address Erik's reservations about using the form refresh in the valid event, I can only say that seemed like a more logical place to put it than the interactive change event since, when a value is selected with the editbox of the combo, I really only want to update after I've verified the validity of the entry, so I don't know where else makes sense.

You may recall a week or so ago that you (Jim) advised me that in similar circumstances you used a separte editbox and combobox (or listbox...cannot remember). I tried that but had a hell of a time trying to bind these two controls together manually so that they'd follow each other and so that the underlying table pointer would also be synchronized. I finally gave up and came back to a pure combobox, which, when I leave the controlsource at its default setting, comes within an eyelash of doing everything I need it to do.
"The Iron Fish: The water is cold...but the fish don't mind"
...Jay Jenks, boyhood chum
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform