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

Dsum

P: n/a
I am trying to have a button on my order form that will work out how
much is outstanding on the order

on the form i have the total value of the the order and also have text

box that i want to dispaly the remaning amount.
I store all the payments in a subform.
The code i use works apart from when no payments are in the subform,
How can i change the code to make it work
RemainingToPay = Total - DSum("[Amount]", "tblPayments", "[OrderNumber]

= Forms![frmOrder]!OrderNumber.Value")

Nov 15 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 15 Nov 2006 09:51:41 -0800, "Simon" <S.*******@shos.co.ukwrote:

That's because if there are no records, DSum returns Null (which you
can test in the Immediate window), and any calculation with null
results in null.
So wrap an Nz() around it, and you should be golden.

-Tom.
>I am trying to have a button on my order form that will work out how
much is outstanding on the order

on the form i have the total value of the the order and also have text

box that i want to dispaly the remaning amount.
I store all the payments in a subform.
The code i use works apart from when no payments are in the subform,
How can i change the code to make it work
RemainingToPay = Total - DSum("[Amount]", "tblPayments", "[OrderNumber]

= Forms![frmOrder]!OrderNumber.Value")
Nov 15 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.