Connecting Tech Pros Worldwide Forums | Help | Site Map

Validation problem with calendar control.

Cong
Guest
 
Posts: n/a
#1: Apr 14 '06
Hi

I have two unbounded text boxes (startdate and enddate). If I
entered the date manually
I can can set validation for the text box for example
[startdate] < date()
this will works but if I have a calendar control populating the
date automaticcaly. It will
bypass the validation. I try this for validation but does
not
cdate([startdate]) < date()

I try to set code for after update event but it does not do
anything. Somehow the
calendar control bypass the validation event as well before
and after update event.


Wayne Morgan
Guest
 
Posts: n/a
#2: Apr 14 '06

re: Validation problem with calendar control.


The AfterUpdate event fires only when you change the control value manually,
not when it is changed through code. You will either need the code that
places the value in the textbox to do the validation (preferable) or you
could do the validation in the textbox's Exit event. If you have the code
that places the value in the textbox do the validation, you may simply be
able to tell it to call the textbox's AfterUpdate event in stead of
rewriting the validation code.

--
Wayne Morgan
MS Access MVP


"Cong" <congngo@yahoo.com> wrote in message
news:1144969832.385322.57370@i39g2000cwa.googlegro ups.com...[color=blue]
> Hi
>
> I have two unbounded text boxes (startdate and enddate). If I
> entered the date manually
> I can can set validation for the text box for example
> [startdate] < date()
> this will works but if I have a calendar control populating the
> date automaticcaly. It will
> bypass the validation. I try this for validation but does
> not
> cdate([startdate]) < date()
>
> I try to set code for after update event but it does not do
> anything. Somehow the
> calendar control bypass the validation event as well before
> and after update event.
>[/color]


Closed Thread