Whats Worng with my Dsum Function? (1 Viewer)

jrub

Registered User.
Local time
Today, 11:21
Joined
Dec 11, 2012
Messages
52
Hi Everyone,

I have a dsum to summ all previous values. It's being used in a continuous form with only max 30 record.

If it's 2013, I want the first record to be 1000, and the rest of the following records be the a running sum.

I get a #Type! error in the first record and a #Error in the remaining records.

Code:
=IIf([StudyYears]="2013",[RunningBalance]="1000",DSum("[RunningBalance]","StudyYears","[StudyYears] <= Forms![FundingPlan]![StudyYears]")
 

AccessMSSQL

Seasoned Programmer-ette
Local time
Today, 11:21
Joined
May 3, 2012
Messages
636
Your are including your Forms!FundingPlan control value within the quotes. Change it to this:
Code:
DSum("[RunningBalance]","StudyYears","[StudyYears] '" & <= Forms![FundingPlan]![StudyYears] & "'")

Also, I would check out setting the value of your runningBalance to a numeric value rather than a string = "1000". change it to 1000 but only if your RunningBalance table field is a text field.
 
Last edited:

Users who are viewing this thread

Top Bottom