Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Linking values of two textboxes
Message
De
18/11/1997 21:34:22
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00061043
Message ID:
00061083
Vues:
26
>>>I am using VFP 3.0.
>>>
>>>I have two text boxes, one contains the date (ld_date) and the other should contain cdow(ld_date) of the date. It seems to me that this should be quite straight forward to do, but I get an error if I set the control source of the second text box to cdow(ld_date).
>>>
>>>It seems that I shouldn't have to programtically set the value of the second textbox from the first, since the first testbox should not be aware of the second textbox. The second textbox should be aware of the first.
>>>
>>>How should this be done?
>>>
>>>Am I even making sense. :-|
>>Evan,
>>
>>I don't think you can set a ControlSource to an expression. There are two ways to do this. One is to have textbox 1 update textbox 2 in its InteractiveChange or LostFocus event. The other would be to put THIS.Value=CDOW(THISFORM.TextBox1) in the Refresh method of TextBox 2. You'll still have to make sure TextBox 2 gets refreshed after TextBox1 is updated.
>
>Okay, method two is the way to go. A refresh is done when the value in textbox1 has changed. Thanks.

You can do it. Enclose the whole expression of the control source in paranthesis like:

( cdow(table.dDate) )

Do not use cdow(thisform.txtDate.value ) in the controlsource property because when init of the textbox is fired, this value may not be a date.

Regards

Abdul Ahad
Abdul Ahad Khan
CSi
www.csi-pk.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform