Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Use of Valid event
Message
 
To
11/09/2006 13:52:59
Chandan Chakraborty
Bangiya Gramin Vikash Bank
Raiganj, India
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 6
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01152818
Message ID:
01152839
Views:
25
Hi Chandan.

I assumed that period = month then you should make a function that
returns the amount of months between the two dates and compare that
value to text4.

if dif_month(text1.value, text3.value) > text4.value
messagebox("Higher value",48")
return 0
endif

function dif_month
parameter date_i, date_f
if year(date_i) = year(date_f)
return month(date_f) - month(date_i)
else
return month(date_f)+ (12 - month(date_i))+ (12 * (year(date_f) - year(date_i) - 1))
endif

(not tested)

>Hello Experts!
>
>In a form I have 4 text. In text1 , text2 and text3 I am entering Date. And in 4th text a period.
>I want to check the period.
>
>In valid event of Text4 I coded
>
>
>
>If ((thisform.text1.value)+(thisform.text4.value))>(thisform.text3.value)
>
>=Message("You have Entered a Higher Period",1)
>return 0
>endif
>
>
>
>i.e, if text1.value=("12/12/2005"),
> text4.value=24,
> text3.value=("12/11/2006")
>I have entered a higher period value at text4.
>
>My code is not giving me the desired result.
>
>Please help me.
>
>Chandan
Previous
Reply
Map
View

Click here to load this message in the networking platform