Re: Nz Function in Control Source



Several things

Make sure your total is in the Report Footer, not the page footer

The expression you want is

=Sum(IIf(IsNull([PremiumGBP]),0,[PremiumGBP]))

HTH

Phil


"colin spalding" <colin.mardell@xxxxxxxxxxxxxxx> wrote in message
news:9240f596-c0c7-476b-8a46-d4d127d44dfe@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Access 2003

I subform which lists financial transactions for a client in the main
form, which i total in a textbox named "txtTotalPremium" in the
subform footer with the Control Source "=Sum([PremiumGBP])"; without
quotations of course. This works fine until the subform has no
records to return in which case textbox is blank. That would be fine
except I need to use the figure in another text box on the main form
as part of another calculation. I have tried hundred different
combination of the Nz and IIf functions all to no avail. it seems to
me that the straight forward "=Nz(Sum([PremiumGBP]),0)" should do it,
but unfortunately not; whatever I do I get a blank textbox and
"#Error" and/or #Name?" in the mainform textbox, Where do I go from
here?


.



Relevant Pages

  • Re: Nz Functions in Control Source
    ... I have a subform which lists financial transactions for a client in ... This works fine until the subform has ... in which case textbox result is blank. ...
    (comp.databases.ms-access)
  • Nz Functions in Control Source
    ... I have a subform which lists financial transactions for a client in ... This works fine until the subform has ... in which case textbox result is blank. ...
    (comp.databases.ms-access)
  • Re: refresh an open form using records from another open form?
    ... Yes, I made the linking textbox visible, and yes the record ID's match ... It's as if the subform only wakes up when I click on it?... ... I click a control on the 'frm_Road_Junctions' form. ... Did you set up the master/child link for the subform control containing ...
    (microsoft.public.access.formscoding)
  • Re: Referencing problem
    ... to return a reference to the form the tab is embeded in. ... If the tab is on a subform, ... You can't use the Me operator or the form reference returned by Me ... located on this subform and the textbox is located on the ...
    (comp.databases.ms-access)
  • RE: Setfocus to a textbox
    ... SetFocus to txtLPN ... txtCurrentASN - Textox on the Main Form ... The subform is linked to txtCurrentASN by Master/Child feilds. ... triggering after the On_Exit event of the textbox? ...
    (microsoft.public.access.forms)