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:06:25
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00144183
Message ID:
00144193
Views:
38
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
Next
Reply
Map
View

Click here to load this message in the networking platform