Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Want to set the value of this.controlsource = this.value
Message
 
 
To
06/10/1998 10:06:25
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00144183
Message ID:
00144202
Views:
45
any thoughts on how to accomplish this if the control source is not a field in a table, but a custom property? believe the replace will only work for a table. also, if the text1 controlsource is blank in the pem, but the grid has a recordsource and is bound, do you think that the text1 controlsource will be populated at run time?


>Brenda --

>One of the problems with textboxes, comboboxes, editboxes (and some others) is that they don't lose focus when a toolbar button is clicked. Therefore, to enforce that the controlsource is set to the current value, in the Click of the button, you need something like:

>cType=_SCREEN.ActiveForm.ActiveControl.BaseClass
>IF INLIST(cType,"Textbox","Combobox","Editbox")
> cSource= _SCREEN.ActiveForm.ActiveControl.ControlSource
> tValue = _SCREEN.ActiveForm.ActiveControl.Value
> REPLACE (cSource) WITH (tValue)
>ENDIF

>Of course, you'll want to add code to trap blank controlsources, null values, etc....

>>doing a work around for validating from the cmdsave on the toolbar. because i call lastcontrol.valid myself, the controlsource is not updated with the value. want to update the controlsource with the value generically. do not want to change all my valid code, since it all references the controlsource now.
>>
>>do not want to actually update the controlsource, but the controlsource's >>value.
>>
>>controlsource = tablex.field1
>>tablex.field1 = .t.
>>
>>want to set tablex.field1 = this.valuel
>>
>>any ideas?
>>
>>brenda
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform