hi again, i am looking for a simple way to Validate the data entered into a
textbox is a valid date.

if they enter 010106 it should stop them and make them enter 01012006
if they enter 01010000 it should evaluate that to be wrong also. is this
possible?
well i know it is, currently i have set century on. My biggest problem is,
this box is used for mostly char entry, so id like to keep it that way.
i thought that using this.value = ctod(' / / ') would do it but no such
luck.

thanks agaiin.

Re: Validating a Date in a Text box by Gene

Gene
Tue Feb 07 14:00:21 CST 2006

On Tue, 7 Feb 2006 09:49:27 -0800, Tom <Tom@discussions.microsoft.com>
wrote:

>hi again, i am looking for a simple way to Validate the data entered into a
>textbox is a valid date.

For the textbox, set
.format="d"

[snip]

Sincerely,

Gene Wirchenko


Re: Validating a Date in a Text box by Cindy

Cindy
Tue Feb 07 14:42:29 CST 2006

Hi Tom,

I'm confused. Your users are entering a date into a textbox. Are you storing
the date as characters or as a date data type? Can they also enter other
things in this textbox such as names or other values that are all digits?

--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy_winegarden@msn.com www.cindywinegarden.com


"Tom" <Tom@discussions.microsoft.com> wrote in message
news:2049B19B-49FA-4FA1-AB79-4632B2A46856@microsoft.com...
> hi again, i am looking for a simple way to Validate the data entered into
> a
> textbox is a valid date.
>
> if they enter 010106 it should stop them and make them enter 01012006
> if they enter 01010000 it should evaluate that to be wrong also. is this
> possible?
> well i know it is, currently i have set century on. My biggest problem is,
> this box is used for mostly char entry, so id like to keep it that way.
> i thought that using this.value = ctod(' / / ') would do it but no such
> luck.
>
> thanks agaiin.



Re: Validating a Date in a Text box by Tom

Tom
Tue Feb 07 15:07:27 CST 2006

Yes Cindy, this is a Multi purpose box. after data is entered depending on
the code they use, i will write it to a table.
but if it comes to a date i really need them to enter it in mm/dd/yyyy so
ive tried to set the format of the box to "d" as mentioned before if a
certain code was used.

"Cindy Winegarden" wrote:

> Hi Tom,
>
> I'm confused. Your users are entering a date into a textbox. Are you storing
> the date as characters or as a date data type? Can they also enter other
> things in this textbox such as names or other values that are all digits?
>
> --
> Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
> cindy_winegarden@msn.com www.cindywinegarden.com
>
>
> "Tom" <Tom@discussions.microsoft.com> wrote in message
> news:2049B19B-49FA-4FA1-AB79-4632B2A46856@microsoft.com...
> > hi again, i am looking for a simple way to Validate the data entered into
> > a
> > textbox is a valid date.
> >
> > if they enter 010106 it should stop them and make them enter 01012006
> > if they enter 01010000 it should evaluate that to be wrong also. is this
> > possible?
> > well i know it is, currently i have set century on. My biggest problem is,
> > this box is used for mostly char entry, so id like to keep it that way.
> > i thought that using this.value = ctod(' / / ') would do it but no such
> > luck.
> >
> > thanks agaiin.
>
>
>

RE: Validating a Date in a Text box by Tom

Tom
Wed Feb 08 11:49:16 CST 2006

why would Foxpro allow an 8 char date. 01/01/05 with Set Century On?

because there is so much going on with this program i decided to do this..
if nlevel = 1
if lagtc.rplwith = "dt"
this.inputmask = "99/99/9999"
this.format ="d"
else
this.inputmask = "XXXXXXXXXXX"
endif
endif
how can i make sure that a 10 char date has been entered?


"Tom" wrote:

> hi again, i am looking for a simple way to Validate the data entered into a
> textbox is a valid date.
>
> if they enter 010106 it should stop them and make them enter 01012006
> if they enter 01010000 it should evaluate that to be wrong also. is this
> possible?
> well i know it is, currently i have set century on. My biggest problem is,
> this box is used for mostly char entry, so id like to keep it that way.
> i thought that using this.value = ctod(' / / ') would do it but no such
> luck.
>
> thanks agaiin.

Re: Validating a Date in a Text box by Matthew

Matthew
Wed Feb 08 12:00:32 CST 2006

Because SET STRICTDATE is set to 0. This isn't a SET CENTURY issue. If you
want to force a 10 char date, SET STRICTDATE 1 or 2.

"Tom" <Tom@discussions.microsoft.com> wrote in message
news:BADB0FD4-E1BE-4BB4-8BE5-C82C45A4EC89@microsoft.com...
> why would Foxpro allow an 8 char date. 01/01/05 with Set Century On?
>
> because there is so much going on with this program i decided to do this..
> if nlevel = 1
> if lagtc.rplwith = "dt"
> this.inputmask = "99/99/9999"
> this.format ="d"
> else
> this.inputmask = "XXXXXXXXXXX"
> endif
> endif
> how can i make sure that a 10 char date has been entered?
>
>
> "Tom" wrote:
>
>> hi again, i am looking for a simple way to Validate the data entered into
>> a
>> textbox is a valid date.
>>
>> if they enter 010106 it should stop them and make them enter 01012006
>> if they enter 01010000 it should evaluate that to be wrong also. is this
>> possible?
>> well i know it is, currently i have set century on. My biggest problem
>> is,
>> this box is used for mostly char entry, so id like to keep it that way.
>> i thought that using this.value = ctod(' / / ') would do it but no
>> such
>> luck.
>>
>> thanks agaiin.



Re: Validating a Date in a Text box by TonySper

TonySper
Wed Feb 08 12:29:10 CST 2006

Tom,
I use the same thing and VFP lets you enter the 06 but as you tab
through it the program changes it to 2006.
TonySper

"Tom" <Tom@discussions.microsoft.com> wrote in message
news:BADB0FD4-E1BE-4BB4-8BE5-C82C45A4EC89@microsoft.com...
why would Foxpro allow an 8 char date. 01/01/05 with Set Century On?

because there is so much going on with this program i decided to do
this..
if nlevel = 1
if lagtc.rplwith = "dt"
this.inputmask = "99/99/9999"
this.format ="d"
else
this.inputmask = "XXXXXXXXXXX"
endif
endif
how can i make sure that a 10 char date has been entered?


"Tom" wrote:

> hi again, i am looking for a simple way to Validate the data entered
> into a
> textbox is a valid date.
>
> if they enter 010106 it should stop them and make them enter
> 01012006
> if they enter 01010000 it should evaluate that to be wrong also. is
> this
> possible?
> well i know it is, currently i have set century on. My biggest
> problem is,
> this box is used for mostly char entry, so id like to keep it that
> way.
> i thought that using this.value = ctod(' / / ') would do it but
> no such
> luck.
>
> thanks agaiin.



Re: Validating a Date in a Text box by Tom

Tom
Wed Feb 08 13:38:06 CST 2006

Tony, yes it does do that for me to, thats ok, if thats all i can do. i have
set strictdate entry to 1 and 2 and both still allow 01/01/03 and not the 10.
i may just have to have it this way.

thank you
"TonySper" wrote:

> Tom,
> I use the same thing and VFP lets you enter the 06 but as you tab
> through it the program changes it to 2006.
> TonySper
>
> "Tom" <Tom@discussions.microsoft.com> wrote in message
> news:BADB0FD4-E1BE-4BB4-8BE5-C82C45A4EC89@microsoft.com...
> why would Foxpro allow an 8 char date. 01/01/05 with Set Century On?
>
> because there is so much going on with this program i decided to do
> this..
> if nlevel = 1
> if lagtc.rplwith = "dt"
> this.inputmask = "99/99/9999"
> this.format ="d"
> else
> this.inputmask = "XXXXXXXXXXX"
> endif
> endif
> how can i make sure that a 10 char date has been entered?
>
>
> "Tom" wrote:
>
> > hi again, i am looking for a simple way to Validate the data entered
> > into a
> > textbox is a valid date.
> >
> > if they enter 010106 it should stop them and make them enter
> > 01012006
> > if they enter 01010000 it should evaluate that to be wrong also. is
> > this
> > possible?
> > well i know it is, currently i have set century on. My biggest
> > problem is,
> > this box is used for mostly char entry, so id like to keep it that
> > way.
> > i thought that using this.value = ctod(' / / ') would do it but
> > no such
> > luck.
> >
> > thanks agaiin.
>
>
>