473,394 Members | 1,746 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Subform calculated control

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
2 1961
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: chris vettese | last post by:
I've been having trouble with this for a long time. I have a form that has many subforms. In the subforms I have unbound text boxes in the footer that sum a field. I want to Display this sum on...
3
by: Charlene | last post by:
I have an Invoice/Invoice Details form/subform. In the page footer of the Invoice Details subform I have a textbox with the control source set to =Sum(). I then pull this value into the main form...
3
by: Andrew Wrigley | last post by:
Hi I have what seems a corruption of an mdb that is not solved by the decompile command line trick. The problem appears when clicking on a subform control (check box) that has a event handler...
2
by: Claude | last post by:
Let' say we have an application for a production facility running 24/7 broken into 3 shifts 6-2,2-10,10-6 each production report date contains 3 shifts as above in each shift there can be from...
5
by: tdmailbox | last post by:
I have a form with a child form. In the child form there is a list of names that can grow quite large. On the parent form I want to display the first name from the child form. I set up a test...
3
by: jburris | last post by:
I have been through enough of these threads to think that this should be an easy fix... but, are there circumstances in which the following code syntax does not work? =!!.Form! (this is out of...
30
by: Shannan Casteel via AccessMonster.com | last post by:
I have a subform named "sbfrmParts" with a list of parts along with the quantity and price. I have used a text box in the subform's footer and set the control source to "=Sum(*)". I set the...
6
by: dhowell | last post by:
I have a "form" and "subform" where I would like a calculated control on the form which sums the values of a datasheet column of the subform. (datasheet on subform may have a variable number of...
4
by: Steve_s | last post by:
Hi I am having problems totalling a particular field in a subform.I am using Access 2003. The subform is based on a query which selects records with various financial information. I have 5 text...
17
by: MariaTorvalds | last post by:
I have a problem where if I use a calculated control, for example =Date()) on my form, PLUS I have a subform on a tab control on the same form, then when I refresh the record (by menu command or VBA...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.