Access IIF IN - Multiple Statements - Formatting Issue

Hello

I have the following IIF statement. If I include just one IIF, this query works. If I include more than one, it does not. Please confirm where the formatting issue is.

Type: IIf([Event] In ("Birthday Party","Sleepover Party","Bake Sale"),"Child Event"),IIF([Event] In ("Movie Theater","Overseas Cruise","Dinner on the Town","Brunch"),"Adult Event")

This was created in notepad as suggested. The first event - child event - works alone. However when I add the second event - adult event - I get an error that I need to include quotations. I have reviewed the quotes, and all seems to be in order.

Thank you
exp vgAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
try:

IIf(  [Event] In ("Birthday Party","Sleepover Party","Bake Sale"),"Child Event" , IIF(  [Event] In ("Movie Theater","Overseas Cruise","Dinner on the Town","Brunch" ,"Adult Event")   )
Rey Obrero (Capricorn1)Commented:
you have closing parenthesis at the wrong place (after "Child event"), it should be at the end of te statement.


copy and paste this


Type: IIf([Event] In ("Birthday Party","Sleepover Party","Bake Sale"),"Child Event",IIF([Event] In ("Movie Theater","Overseas Cruise","Dinner on the Town","Brunch"),"Adult Event",""))

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
PatHartmanCommented:
You have also not included a final false path but Rey's solution addresses that by returning an empty string.  An alternative is to give it a value.

Type: IIf([Event] In ("Birthday Party","Sleepover Party","Bake Sale"),"Child Event",IIF([Event] In ("Movie Theater","Overseas Cruise","Dinner on the Town","Brunch"),"Adult Event","Event Not Found"))
exp vgAuthor Commented:
Finally got this to work. Thank you everyone.
exp vgAuthor Commented:
Thank you everyone.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.