IsError Function

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
 
T

Terry

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top