Discussion:
A97 to A2003 & IIf
(too old to reply)
Bill B
2008-02-21 14:12:54 UTC
Permalink
Hi All

I have a report that is throwing an error on a text field field. below is
the condition. I'm thinking the 'In' condition is causing the problem and I
can't seem to find anything with google regarding the use of 'In' in a VBA
IIF statement.

=IIf([test_typ]="TENS" And [shape]="RECT" And [thick]<=0.16 And [testmeth]
In ("48","41","42","43","44") And Not ([prod_fac] In ("LAB","2XX","3XX"))
And Not ([sps] In
("1156","1189","1203","1209","1227","1235","1165","2507","2541","2546","2547")),
"ROBOTIC",IIf([Shape]="JIS","JIS",IIf([Shape]="API","API","")))

Any suggestions??

Bill
d***@epsomdotcomdotau
2008-03-01 06:24:43 UTC
Permalink
That does not appear to be a VBA IIF statement. It appears
to be a control source. If it is a VBA IIF statement, split it
into a an If Then Else statement, and find that part that is failing.

If it is a control source, split it into several controls and see
which part is failing. My bet would be on one of the [] values:
A2003 is less flexible with those references than any previous
version.

I don't see anything wrong with any of the IN conditions, but
split it up into sections and see where it fails.

(david)
Post by Bill B
Hi All
I have a report that is throwing an error on a text field field. below is
the condition. I'm thinking the 'In' condition is causing the problem and I
can't seem to find anything with google regarding the use of 'In' in a VBA
IIF statement.
=IIf([test_typ]="TENS" And [shape]="RECT" And [thick]<=0.16 And [testmeth]
In ("48","41","42","43","44") And Not ([prod_fac] In ("LAB","2XX","3XX"))
And Not ([sps] In
("1156","1189","1203","1209","1227","1235","1165","2507","2541","2546","2547
")),
Post by Bill B
"ROBOTIC",IIf([Shape]="JIS","JIS",IIf([Shape]="API","API","")))
Any suggestions??
Bill
Loading...