A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Sum of values in a form



 
 
Thread Tools Display Modes
  #1  
Old November 19th, 2009, 05:42 PM posted to microsoft.public.access.forms
Pascoe via AccessMonster.com
external usenet poster
 
Posts: 32
Default Sum of values in a form

Folks,

I have read numerous threads on this topic, and understand that in order for
my Sum() to work I need to ensure all references are made back to the Record
Source.

I have endeavoured to do this, but am still getting #Error.

I am trying to Sum the revenue each tenant provides in a given date range, to
give a total revenue figure. If the date range is a whole month, then the
expression just takes the value of Rent PCM, and not (Rent PCM*(12/52)) * No.
of Days,
which would give some unusual results.

My Expression looks like this:

=Sum(Nz(IIf([Short Let]=-1,[Rent pcm],IIf(Day([Forms]![Revenue Report]![Start
Date Chosen])=1 And (Day([Forms]![Revenue Report]![End Date Chosen])=Day
(DateSerial(Year([Forms]![Revenue Report]![Start Date Chosen]),Month([Forms]!
[Revenue Report]![Start Date Chosen])+1,0))) And (Month([Forms]![Revenue
Report]![Start Date Chosen])=Month([Forms]![Revenue Report]![End Date Chosen]

)) And (Year([Forms]![Revenue Report]![Start Date Chosen])=Year([Forms]!
[Revenue Report]![End Date Chosen]))=-1 And [Moved In]=[Forms]![Revenue
Report]![Start Date Chosen] And ([Moved Out]=[Forms]![Revenue Report]![End
Date Chosen] Or [Moved Out] Is Null),[Rent pcm],DateDiff("d",IIf([Moved In]=
[Forms]![Revenue Report]![Start Date Chosen],[Forms]![Revenue Report]![Start
Date Chosen],[Moved In]),IIf([Forms]![Revenue Report]![End Date Chosen]=
[Moved Out] And [Moved Out]=[Forms]![Revenue Report]![Start Date Chosen],
[Moved Out],[Forms]![Revenue Report]![End Date Chosen]))*([Rent pcm]*(12/365)

)))))

I wonder whether referencing back to another form where I have entered the
dates for the query range (Start Date Chosen and End Date Chosen) are the
current cause of my problem.

Any thoughts gratetfully received.

Kind Regards,
Russell.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200911/1

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:30 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.