Expression error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am getting an error in the following expression:

Facility: IIf(Mid([Unit],1,1)="B",[Unit], IIf(Mid([Unit],1,1)="F" And
Mid([Unit],3,1)>=0,Right([Unit],7, IIf(Mid([Unit],3,1)="G",
Right([Unit],8))))))

The error says "The expression you entered has a function containing the
wrong number of arguments. I can break these IIf statements up and they work
seperately and even two together but I cannot get all three to work together.
Any Ideas?

Thanks,

Dennis
 
Try this:

IIf(Mid([Unit],1,1)="B",[Unit],IIf(Mid([Unit],1,1)="F" And Mid([Unit],3,1)
=0,Right([Unit],7),IIf(Mid([Unit],3,1)="G", Right([Unit],8), "missing
argument")))

But you need to replace "missing argument" for whenever Mid([Unit],3,1)="G"
is false.
 
SteveW via AccessMonster.com said:
Try this:

IIf(Mid([Unit],1,1)="B",[Unit],IIf(Mid([Unit],1,1)="F" And Mid([Unit],3,1)
=0,Right([Unit],7),IIf(Mid([Unit],3,1)="G", Right([Unit],8), "missing
argument")))

But you need to replace "missing argument" for whenever Mid([Unit],3,1)="G"
is false.
Steve,

Works well, thanks,

Dennis
 
Back
Top