IsError Function

  • Thread starter Thread starter Barry
  • Start date Start date
B

Barry

Hi, there,

I am preparing a report for presentation for the % of
discount, So a field for Discount and a field for Sales
and I create one more field for [Discount]/[Sales] in my
report.

As I got #Div/0 or #num, I create the following in the
control

IIf(IsError([discount]/[Sales]),"ERROR",[discount]/Sales])

If IsError is false, the formula can give the correct
amount, but in case of Div/0!, it cannot give "ERROR"
message but still shows Div/0 message, However, when I
create another temp field for [discount]/[Sales] and use
the conditioning forumula to test such field, the forumla
works! I cannot figure out how to correct it, please help.

Thank you.

Barry
 
Barry,

I have a feeling the iserror (and some other like
functions) don't work when used in controls (only in VB
modules or sumthing). Either limit your record set in a
query or try Iif([sales]=0,"No Sales", [discount]/
[sales]).

Someone more expert than me will hopefully enlighten us
all.

Best of luck,

Terry
 
Back
Top