Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Right way with combo box control?
Message
From
03/06/2008 09:13:59
 
 
To
02/06/2008 14:29:11
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01320984
Message ID:
01321267
Views:
17
>Hi Tamar,
>
>I got things mostly working but ran into a bit of a glitch. I have two combo boxes (primary and secondary annuitant) and besides updating a property at the time the form is instantiated, this property needs updating if the user changes either list. So I wrote a method to do do the updating and I call it near the end of the form instantiation.
>
>1) I tested and when the form first instantiates that the combo boxes do not yet have any values in them for .ListItemID etc (they are not yet visible and so my guess is that they do not have their values set yet). So I switched to reading the values from the view that they are bound to. This works.
>
>2) I then inserted a call to this same .UpdatePlaintiffNames() method to various methods on each combo box - I tried augmenting .Click() and .Valid() but at the point that these fire, it seems that the view's field has not yet been updated yet.
>
>3) It seems like I have to insert the call in the .LostFocus() event because by that point the view field is up to date.
>
>Although this "works", it seems like I should be doing this closer to the time that the user "clicks" something but I could not find an event that fires and does so after the bound field has been updated. Any suggestions? I did not want to go back to using .ListItemID as that is not filled in upon form instantiation (I guess I could check the .ListItemID property and if it is empty, also check the view field but that seems kludgy).

Click is definitely not what you want; it's way too early. The one I tend to trip over is InteractiveChange, which is also too early, if you want to use the ControlSource.

But Valid should work. By the time you get to Valid, the ControlSource should have been updated.

Tamar
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform