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
05/08/1999 01:21:18
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00249541
Message ID:
00250071
Views:
22
>David,
>
>In this case dump the rowsource you are using and use a rowsourcetype of Fields, then set the columncount to the number of fields you want to display in the combo. Then set thr rwosource to alias.field1,field2,... use the same alias as the rest of the form. Now using the combo will move the record pinter in the alias so all you need is to refresh the form from the interactivechange or the valid.

I already do this. Except I think the column count is 0 not 1...which seems to work. Doesn't interactivechange fire with each keystroke as you enter a value into the textbox portion of the combo?

>
>By the way, I am a firm believer that it should be impossible for a user to make an invalid selection in a combo. You ahve complete control over what is in the list and therefore should remove any items that are invalid.

I think you responded thinking that I was using other than a rowsourcetype of FIELDS and that made you think I could have an illegal value in the combolist.
The only way for an illegal value to be entered is in the combo textbox and I take care of this case in the valid. By the way, the way I set things right if a bad value was entered is to set mycombo.value = str(nlastgoodvalue) and requery. Not sure if this is the recommended approach for setting the combo's value programmatically...but it's my best guess given the descriptions I've been able to find in the VFP docs for how things work. The code which detects and corrects a bad textbox entry is certainly a candidate for my original x to y to x problem, but well placed breakpoints seem to indicate that it is not the culprit. (ie, I can evoke the x,y,x problem without entering an illegal value, and a breakpoint in the 'bad value' branch of the valid never fires for unintended reasons)

The controlsource still seems like it might be the key to my original problem. If I set the value of mycombo.controlsource = None (the default), does VFP create its own controlsource for the combo? Does it make sense to set BoundTo = .T. if controlsource = None?
"The Iron Fish: The water is cold...but the fish don't mind"
...Jay Jenks, boyhood chum
Previous
Reply
Map
View

Click here to load this message in the networking platform