iif in validation

ice-9

Registered User.
Local time
Today, 14:29
Joined
May 21, 2004
Messages
88
Is it posible to use a iif statment in a validation statment ?
i have one table project and i want to check the occurens.

IIF ([ProjectStatus] = 1 ,[ProjectCompletedDate] = NULL, [ProjectCompletedDate]<> NULL)

when the projectstatus is 1, the date cant be filled in.
is this possible in access ?
or can it only be done form based?

thanks for the reply :)
 
ice-9 said:
IIF ([ProjectStatus] = 1 ,[ProjectCompletedDate] = NULL, [ProjectCompletedDate]<> NULL)

when the projectstatus is 1, the date cant be filled in.
is this possible in access ?

It is possible to achieve. NB: I'm asserting no recommendation on whether or not you should do it.

However, don't use an "iif"; write an expression that will evaulate to True when the business rules are met.

([ProjectStatus] = 1 And IsNull([ProjectCompletedDate])) OR ([ProjectStatus] <> 1 And Not IsNull([ProjectCompletedDate]))

HTH

Regards

John.
 
Last edited:
addendum to above - That would be a Validation Rule of the entire Table, not a field's Validation Rule.
 
thanks alot john.
Im checking it out right now!

works as a bus! thanks
 
Last edited:
ice-9 said:
works as a bus! thanks

I don't know how busses work where you are - but in my home town I don't think that would be a complimentary expression :D

I'll take the "thanks" to imply your busses are better than ours !

Glad to have helped. Thanks for replying back.

Regards.

John.
 
john471 said:
I don't know how busses work where you are - but in my home town I don't think that would be a complimentary expression :D

I'll take the "thanks" to imply your busses are better than ours !

Glad to have helped. Thanks for replying back.

Regards.

John.

busses are good here john, its a compliment, but you knew that ;)
 

Users who are viewing this thread

Back
Top Bottom