Main Form Sub Form Has Data Calculation

C

Cy

Merry Christmas all,

Hope everyone has had a great Christmas. I hope, even more that
someone might be able to shed some light on a problem I am running
into.

I have a form, that has a sub form. The main form is estimateLM, sub
form is estimateLMAnnual. In the sub form, I have a fields, called
txtLMAnnualTtl, for calculating the totals. I then grab this total
and display it on the main form and on several other tabs on the main
form. I do this by using =EstimateLMAnnuals.Form!txtLMAnnualTtl.
This works great when there is data in the subform. However, when I
have nothing in it, I want to show 0 for a result. So, I thought it
might be like on reports, iif(reportname.report.hasdata=0,0,some
process). But if I try iif(formname.form.hasdata=0,0,some process),
that gives me #name. So, I am guessing that Access 2000 does not
support the hasdata on subforms.

So, does anyone have any thoughts? Suggestions?
 
R

ruralguy via AccessMonster.com

Try:
=If IsError(EstimateLMAnnuals.Form!txtLMAnnualTtl,0,EstimateLMAnnuals.Form!
txtLMAnnualTtl)
 
C

Cy

Thanks. Syntex was off a bit. Should be IsError
(iif(estimatelmannuals.form!txtlmannualttl,0,estimatelmannuals.form!
txtlmannualttl)). Once I corrected that, all works good.

Thanks a bunch for the assist.
 
R

ruralguy via AccessMonster.com

Glad I could help. Merry Christmas.
Thanks. Syntex was off a bit. Should be IsError
(iif(estimatelmannuals.form!txtlmannualttl,0,estimatelmannuals.form!
txtlmannualttl)). Once I corrected that, all works good.

Thanks a bunch for the assist.

Try:
=If IsError(EstimateLMAnnuals.Form!txtLMAnnualTtl,0,EstimateLMAnnuals.Form!
[quoted text clipped - 25 lines]
Message posted viahttp://www.accessmonster.com
 

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