Access nested IIF's

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

haydenbl

Thread Starter
Joined
Jul 6, 2018
Messages
1
I have looked at this statement too long and still can't figure it out. I know it's something easy, but I just can't see it. I get the error statement "The expression you entered has a function containing the wrong number of arguments."

This is my IIF statement:

UserState: Left(Trim(IIf([Temp10] Like "*NEW USER'S REGION*",
Trim(Replace([Temp10],"NEW USER'S REGION:","")),
IIf([Temp9] Like "*NEW USER'S LOCATION INFO: USA-FRA*",
Replace([Temp9],"NEW USER'S LOCATION INFO: USA-FRA>>","")),
IIf([Temp9] Like "*NEW USER'S LOCATION INFO: USA-FRAC-FRA*",
Replace([Temp9],"NEW USER'S LOCATION INFO: USA-FRAC-FRA>>","")))),2)



Thanks for your help.
 

OBP

Joined
Mar 8, 2005
Messages
19,895
It is a tricky one without actually building it, but it looks as if you have 8 Right Hand ( and 9 Left Hand )
 

Chawbacon

Jack
Joined
Jul 9, 2018
Messages
627
Hello Haydenbl,

It appears that you have three independent IIF statements instead of one Nested IIF statement in your expression. This observation is based upon the non-quoted comma placement. Therefore, having three independent arguments, Access throws up the wrong number of arguments error.

UserState:
1. Left(Trim(IIf([Temp10] Like "*NEW USER'S REGION*",
Trim(Replace([Temp10],"NEW USER'S REGION:","")),

2. IIf([Temp9] Like "*NEW USER'S LOCATION INFO: USA-FRA*",
Replace([Temp9],"NEW USER'S LOCATION INFO: USA-FRA>>","")),

3. IIf([Temp9] Like "*NEW USER'S LOCATION INFO: USA-FRAC-FRA*",
Replace([Temp9],"NEW USER'S LOCATION INFO: USA-FRAC-FRA>>","")))),2)

You could try a variation on the following: (I have not checked this... Just a quick modification idea)

UserState: Left(Trim(IIf([Temp10] Like "*NEW USER'S REGION*",
Trim(Replace([Temp10]"NEW USER'S REGION:")),
IIf([Temp9] Like "*NEW USER'S LOCATION INFO: USA-FRA*",
Replace([Temp9],"NEW USER'S LOCATION INFO: USA-FRA>>"),
IIf([Temp9] Like "*NEW USER'S LOCATION INFO: USA-FRAC-FRA*",
Replace([Temp9],"NEW USER'S LOCATION INFO: USA-FRAC-FRA>>)",")))

I hope this helps,

Chawbacon
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top