Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Linking values of two textboxes
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00061043
Message ID:
00061051
Views:
28
>>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform