Full Version: Two-Tiered Expression
UtterAccess Discussion Forums > Microsoft® Access > Access Queries
Frogfall
I am currently working on an Employee Database dealing with various vaccinations, and have run into a bit of a snag. I’m adding in an optional vaccination that has both an annual and a six-month titre.
I’m trying to add in an expression that checks to see if the six-month titre box has been checked off, but I don’t have much experience in VB, and haven’t used what I DO know for years.

I’m basically looking at something along the lines of:

IF [VaccinationRequired] = Yes and [6monthtitre] = Yes, then [TitreReview] = [LastTitre]+6 months Or IF [VaccinationRequired] = Yes and [6monthtitre] = NO, then [TitreReview] = [LastTitre]+12 months

But I have no idea how to get this working properly. Any help would be appreciated.
theDBguy
Hi,

Welcome to Utter Access!

You can try the IIf() statement, such as:

TitreReview: IIf([VaccinationRequired] And [6monthtitre], DateAdd("m", 6, [LastTitre]), DateAdd("m", 12, [LastTitre]))

(untested)
Hope that helps...
Frogfall
Works Great, thanks.

I knew about the IIf() statement, but couldn't get it to actually work without seeing how a complete string looked. Thanks a lot.
theDBguy
You're welcome. Glad we could help. Good luck with your project.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.