By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,281 Members | 2,018 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,281 IT Pros & Developers. It's quick & easy.

Subform calculated control

P: n/a
Hi,
I have 3 nested forms and wish to calculate a value on Subform 1 by
adding 2 values on the same subform [deppd]+[rentpd] to a value in a
control [Sumpd] on the footer of the underlying subform
[transactiontbl subform]. I use this as the recordsource for my total

=[transactiontbl subform].Form!Sumpd+[deppd]+[rentpd])

which works well except when there are no records in the
transactiontbl subform - I get an error.
How do I test for this error and just get [deppd]+[rentpd]as a result.
I've tried using Iif, but as a newbie am stuck on creating the
expression
Thanks
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
You probably have to convert all the nulls (no value) to zeroes. Use
the NZ() function.

=NZ([transactiontbl subform].Form!Sumpd)+NZ([deppd])+NZ([rentpd])

Nov 13 '05 #2

P: n/a
Try using the built-in Null-to-Zero function, as in

=NZ([transactiontbl subform].Form!Sumpd)+[deppd]+[rentpd])

That will work for a Null value. I fear it will not work if the Sumpd
Control does not exist... I'm sure you are aware that attempting to display
a Form bound to a Table/Query with no records does not even display the
Controls, unless some of the Fields are updateable. I really don't know how
that may affect your Sumpd Control in the footer.

Larry Linson
Microsoft Access MVP
"Bruce" <on***********@hotmail.com> wrote in message
news:39**************************@posting.google.c om...
Hi,
I have 3 nested forms and wish to calculate a value on Subform 1 by
adding 2 values on the same subform [deppd]+[rentpd] to a value in a
control [Sumpd] on the footer of the underlying subform
[transactiontbl subform]. I use this as the recordsource for my total

=[transactiontbl subform].Form!Sumpd+[deppd]+[rentpd])

which works well except when there are no records in the
transactiontbl subform - I get an error.
How do I test for this error and just get [deppd]+[rentpd]as a result.
I've tried using Iif, but as a newbie am stuck on creating the
expression
Thanks

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.