validation rule for unbound date control

pcs

Registered User.
Local time
Today, 00:43
Joined
May 19, 2001
Messages
398
think i have 'brain-fade'. (no comments please)

i have an unbound date field on a form. when an illegal date is entered, like 02/30/2001, i get:

The value you entered isn't valid for this field...

yes, i know how to handle this with VBA! but, i'm just certain i once wrote a validation rule that took care of this. but, i can't find it! maybe i just need a nap.
smile.gif


any ideas...

al
 
On the All Tab of the properties, there is Format and Input mask options.

The validation rule property is on the Data tab.

Hope that is what you were trying to recall.
 
jwindon,

no, i'm not quite that bad off yet
smile.gif


know where the validation rule is, just don't know what the hell to put there!
smile.gif


al
 
I don't have time today to test the theory but IsDate([YourField]) should work
smile.gif
 
rich,

i tried that, but no joy
frown.gif

the default:
The value you entered isn't valid for this field...
fires before the validation rule.

i know i can change the textbox to non-date and then use VBA after entry to check it, but i'm just positive i have done this using the validation rule/text.

any other ideas?
 
I have played around with this before .....

Access seems to catch the error before any code you can place in any event or validation rule. I really don't know of a solution.

RDH
 
RDH,

thanks...think you are right.

al
 
This is kinda strange, I have date field formatted as short date, windows set to dd/mm/yyyy, I only type in the last two digits of the year and win fills in the rest.
I set the validation rule to >#01/02/1959# and entered a validation msg. Any date I entered as dd/mm/yy that was not a valid date brought up my own msg, the only date that wouldn't work was 29/02/01 which access changed to 01/02/2029 and accepted, it may work in a country with the Months the wrong way around
smile.gif
 
wierd indeed...probably another 'undocumented feature'.
sure wish i could pass off my bugs as 'undocumented features'
smile.gif


in any case, i can't move to another country (my neighbors' hopes notwithstanding).

it just strikes me as odd that Jet goes to the trouble of establishing date validity, then kicks out a really generic error message that confuses the user.

think i will take this up with Bill G. the next time we go fishing.

thanks to all for the efforts...

al



[This message has been edited by pcs (edited 11-04-2001).]
 

Users who are viewing this thread

Back
Top Bottom