Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DSum ref to Form or Report

Status
Not open for further replies.

rproactive

Technical User
Oct 6, 2005
65
US
Hello - hope someone can help with a sum problem.

Report R_DepositSlip bound to M_DepositSlip. The report is initiated by a command button on a form. The form also supplies data from the report. I am having problems summing data on the report. The identical data is summed on the form and this works fine. I can’t get the report to sum.

Details:

The report sum is in txtSumTotal
Code:
Control Source:  =DSum("[FundPaidAmount]","[M_FundPaid]", 
"[FundPaidTypeFunds_IDs]>0 AND [FundPaidRRS_IDs]=[cboRentRollMonth] And [FundPaidRRSub_IDs]=[cboDepositNumber]")
which returns a null result.

[FundPaidAmount] are dollars to be totaled in table M_FundPaid

[FundPaidTypeFunds_IDs]>0 are type of funds (Coin, Currency etc)in table M_FundPaid

[FundPaidRRS_IDs]=[cboRentRollMonth]
1st is a value in M_FundPaid
2nd is cbo on form BUT is also on the report (same name)

[FundPaidRRSub_IDs]=[cboDepositNumber]
1st is a value in M_FundPaid
2nd is cbo on form BUT is also on the report (same name)
I think the 2nd part is the problem.[/color red]

Help
 
Are all the fields you need to calculate on included in the report's record source? Are you attempting to sum a value from your report's record source or is your sum from some table or query that is not the report's record source?

This might work but I don't know if cboRentRollMonth is a field or control or in the same section of the report. Same for cboDepositNumber.

Code:
=DSum("[FundPaidAmount]","[M_FundPaid]", 
"[FundPaidTypeFunds_IDs]>0 AND [FundPaidRRS_IDs]=" & [cboRentRollMonth] & " And [FundPaidRRSub_IDs]=" & [cboDepositNumber])


Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top