My Assistant
![]() ![]() |
|
|
Jul 8 2009, 09:58 AM
Post
#1
|
|
|
New Member Posts: 9 |
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. |
|
|
|
Jul 8 2009, 10:22 AM
Post
#2
|
|
|
Access Wiki and Forums Moderator Posts: 48,592 From: SoCal, USA |
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... |
|
|
|
Jul 8 2009, 11:10 AM
Post
#3
|
|
|
New Member Posts: 9 |
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. |
|
|
|
Jul 8 2009, 12:01 PM
Post
#4
|
|
|
Access Wiki and Forums Moderator Posts: 48,592 From: SoCal, USA |
You're welcome. Glad we could help. Good luck with your project.
|
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 18th June 2013 - 05:05 PM |