A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Why won't the Nz function work?



 
 
Thread Tools Display Modes
  #1  
Old May 25th, 2004, 09:16 PM
ABaggott
external usenet poster
 
Posts: n/a
Default Why won't the Nz function work?

I am trying to set up controls on a form that will return the count and the sum of values in a subform and show 0 if there are no records in the subform. I set up controls in the form footer of the subform using (for example) Nz(Sum([Cost],0). This returns an accurate sum of the cost field if there are records in the subform, but the field seems to be null if there are no records in the subform. I have done the exact same thing in a different set of forms and subforms in a different database, and it works there; but I cannot get it to work in this one. It's driving me straight up the nearest wall. Anybody have any ideas?
  #2  
Old May 25th, 2004, 09:45 PM
TPratt
external usenet poster
 
Posts: n/a
Default Why won't the Nz function work?

Try: Sum(Nz([Cost]))



"ABaggott" wrote in message
...
I am trying to set up controls on a form that will return the count and

the sum of values in a subform and show 0 if there are no records in the
subform. I set up controls in the form footer of the subform using (for
example) Nz(Sum([Cost],0). This returns an accurate sum of the cost field
if there are records in the subform, but the field seems to be null if there
are no records in the subform. I have done the exact same thing in a
different set of forms and subforms in a different database, and it works
there; but I cannot get it to work in this one. It's driving me straight up
the nearest wall. Anybody have any ideas?


  #3  
Old May 26th, 2004, 12:30 AM
Graham R Seach
external usenet poster
 
Posts: n/a
Default Why won't the Nz function work?

I think TPratt meant:
Sum(Nz([Cost], 0))

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyT...764559036.html


"TPratt" wrote in message
...
Try: Sum(Nz([Cost]))



"ABaggott" wrote in message
...
I am trying to set up controls on a form that will return the count and

the sum of values in a subform and show 0 if there are no records in the
subform. I set up controls in the form footer of the subform using (for
example) Nz(Sum([Cost],0). This returns an accurate sum of the cost field
if there are records in the subform, but the field seems to be null if

there
are no records in the subform. I have done the exact same thing in a
different set of forms and subforms in a different database, and it works
there; but I cannot get it to work in this one. It's driving me straight

up
the nearest wall. Anybody have any ideas?




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:30 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.