Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Date data type
Message
 
À
25/02/1998 10:46:12
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00080922
Message ID:
00081127
Vues:
51
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform