Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Validate Textbox value?
Message
 
To
15/04/2003 15:06:03
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Miscellaneous
Thread ID:
00777948
Message ID:
00778152
Views:
20
>Ok, it is stupid question of the week time. I have (2) Begin date and End date text boxes. The (B)Begin date text box value cannot be greater than the (A) End Date text box. (How can you start a new date range when the other hasn't completed yet?) Here is what I need to do, when the user types in a value into the (B) Begin Date, I want to check that the value is greater than that view value used to populate (A) End Date. I have the correct code to check, but my problem is what text box method to put it in. I tried InteractiveChange, and LostFocus, but they only work sporadically. What am I doing wrong? So, where do I stick it? <vbg>
>
>if this.Value > v_calinfo.dregend
> messagebox('Summer begin date must be greater than the regular term end date.', 48, 'Summer begin date error')
> this.Value = v_calinfo.dregend + 1
>endif
>

>TIA

In addition to the other good suggestions, we've got a date class that has a few additional properties: cStartControl & cEndControl. If you drop two of these controls on the same form and fill in the "path" to the other control (eg. "ThisForm.txtStartDate") in one property, and then the path in the other control in the other property, both controls work together. If the user enters an ending date before the start date, the start date is automatically set to the same date as the end date. If the user enters a start date after the end date, the end date is automatically set to the start date. We've found it's not quite as obnoxious as the "Check your dates, dummy!" type message(s). Just an idea.
-Paul

RCS Solutions, Inc.
Blog
Twitter
Previous
Reply
Map
View

Click here to load this message in the networking platform