General information
Category:
Forms & Form designer
>>>I’ve got a form (part of a formset) in VFP5 under WinNT3.51. Things start out with the focus set to a textbox - based on the textbox input, I want several other controls on the form to have their values changed programmatically.
>>>
>>>The *problem* is that if I leave the textbox by clicking on another control, everything works fine, but if I leave by pressing TAB, not all other controls get updated.
>>>
>>>In particular, I’ve got a combobox with a SQL rowsourcetype that I’m trying to set the value of. There’s a line in the Valid code of the textbox that’s close enough to:
>>>thisform.cboMainLite.Value = cNewMLValue
>>>
>>>Again, this works FINE if I click to another control, but fails if I leave the textbox by tabbing (all other things being, as far as I can tell, equal). By failing I mean that the combobox displays nothing - although the debugger says that the Value *and* DisplayValue properties are what they should be. Forcing a form Refresh doesn’t seem to help.
>>>
>>>Any replies greatly appreciated!
>>>-dan rochman
>>Will it make any difference in your case if you try to set DisplayValue instead of Value?
>
>Yes. It's really elusive thing. Sometimes Value works but sometimes DisplayValue programmatic setting is required too. Also I see that the most reliable RowSourse is a cursor alias.
I tried setting the Value *and* DisplayValue properties - no luck.
The oddest part is that setting *just* the Value property suffices *if* I leave the control by clicking on some other control. If I leave by pressing TAB, it doesn't work...
I turned event tracking on in the debugger... Can anyone tell me why, if I leave a control via TAB, I get a KeyPress(4, 0) event generated in the next control in the tab order? And then a KeyPress (19, 0) event in the control after that!! All I hit was TAB! Strange things are afoot.
Thanks to Nick/Edward for the replies, though,
-dan
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