Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Want to set the value of this.controlsource = this.value
Message
From
06/10/1998 10:23:20
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00144183
Message ID:
00144204
Views:
44
Hi Brenda ---

A property of what? If the form, you could always use PEMSTATUS on ActiveForm to check if a form property and change out the REPLACE with =.

As to grid......could you be more specific?

>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
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Reply
Map
View

Click here to load this message in the networking platform