Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Date data type
Message
 
To
25/02/1998 10:46:12
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00080922
Message ID:
00081127
Views:
47
>I currently have the user typing in the last day of the month and they don't like it. Any ideas?

Create a textbox object with the following properties:
.Format = R
.InputMask = 99/9999 (I would use 4-digit year)

Then in the Valid method put this code:
LOCAL lcMonth, lcYear, ldFirstDOM, ldLastDOM
lcMonth = LEFT(THIS.Value, 2)
lcYear  = RIGHT(THIS.Value, 4)

*-- convert value to a date
ldFirstDOM = CTOD(lcMonth + "/1/" + lcYear)
ldLastDOM  = GOMONTH(ldFirstDOM, 1) - DAY(GOMONTH(ldFirstDOM, 1))

REPLACE MyTable.MyDateField WITH ldLastDOM
...or something along those lines.

HTH
Previous
Reply
Map
View

Click here to load this message in the networking platform