473,505 Members | 16,544 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

subform and SUM

Hello,

Any help would be appreciated!!!

I need to sum AMOUNTTEND on a receipts subform that meet a certain criteria.

It has to be something like.

=sum([amounttend]) where [description]="tour installment"

in other words, I want to total only the amounts when the description field
= "tour installment"

Can anyone help with the correct syntax?

Thanks,

Dave
Nov 3 '07 #1
14 1855
On Sat, 03 Nov 2007 01:54:45 GMT, "David Grist" <di*****@verizon.net>
wrote:

Check out DSum in the help file.
-Tom.
>Hello,

Any help would be appreciated!!!

I need to sum AMOUNTTEND on a receipts subform that meet a certain criteria.

It has to be something like.

=sum([amounttend]) where [description]="tour installment"

in other words, I want to total only the amounts when the description field
= "tour installment"

Can anyone help with the correct syntax?

Thanks,

Dave
Nov 3 '07 #2
I checked out dsum but that is summing the whole table.
"Tom van Stiphout" <no*************@cox.netwrote in message
news:r8********************************@4ax.com...
On Sat, 03 Nov 2007 01:54:45 GMT, "David Grist" <di*****@verizon.net>
wrote:

Check out DSum in the help file.
-Tom.
>>Hello,

Any help would be appreciated!!!

I need to sum AMOUNTTEND on a receipts subform that meet a certain
criteria.

It has to be something like.

=sum([amounttend]) where [description]="tour installment"

in other words, I want to total only the amounts when the description
field
= "tour installment"

Can anyone help with the correct syntax?

Thanks,

Dave

Nov 3 '07 #3
try

=Sum(IIf([description]="tour installment",[amounttend],0)

hth
"David Grist" <di*****@verizon.netwrote in message
news:FxQWi.71$Cc.56@trndny09...
Hello,

Any help would be appreciated!!!

I need to sum AMOUNTTEND on a receipts subform that meet a certain
criteria.
>
It has to be something like.

=sum([amounttend]) where [description]="tour installment"

in other words, I want to total only the amounts when the description
field
= "tour installment"

Can anyone help with the correct syntax?

Thanks,

Dave


Nov 3 '07 #4
On Sat, 03 Nov 2007 04:43:01 GMT, "David Grist" <di*****@verizon.net>
wrote:

Not if you put in a where clause as the 3rd argument:
=dsum("AmountEnd", "SomeTable", "Description='tour installment'")

-Tom.
>I checked out dsum but that is summing the whole table.
"Tom van Stiphout" <no*************@cox.netwrote in message
news:r8********************************@4ax.com.. .
>On Sat, 03 Nov 2007 01:54:45 GMT, "David Grist" <di*****@verizon.net>
wrote:

Check out DSum in the help file.
-Tom.
>>>Hello,

Any help would be appreciated!!!

I need to sum AMOUNTTEND on a receipts subform that meet a certain
criteria.

It has to be something like.

=sum([amounttend]) where [description]="tour installment"

in other words, I want to total only the amounts when the description
field
= "tour installment"

Can anyone help with the correct syntax?

Thanks,

Dave
Nov 3 '07 #5
Unfortunately, none of the offered solutions are working for me

I tried, on the subform, ....

=dsum("[amounttend]","[receipts]","[description]=2")

this sums ALL records meeting the criteria in the receipts table and not
just the membership record I'm working on. If there was a way to put an
"AND" argument after the description qualifier, that might work? For
instance...

=dsum("[amounttend]","[receipts]","[description]=2" AND
"[studentid]=forms![student account data].studentid)

that might work.... is there a way?

"David Grist" <di*****@verizon.netwrote in message
news:FxQWi.71$Cc.56@trndny09...
Hello,

Any help would be appreciated!!!

I need to sum AMOUNTTEND on a receipts subform that meet a certain
criteria.

It has to be something like.

=sum([amounttend]) where [description]="tour installment"

in other words, I want to total only the amounts when the description
field = "tour installment"

Can anyone help with the correct syntax?

Thanks,

Dave



Nov 3 '07 #6
On Sat, 03 Nov 2007 19:31:52 GMT, "David Grist" <di*****@verizon.net>
wrote:

Of course you can have an AND condition. Any legal WHERE clause is
allowed.
Curious that earlier "Description" was a text field, whereas now it
appears a numeric field.
=dsum("[amounttend]","[receipts]","[description]=2 AND
[studentid]=" & forms![student account data].studentid)

-Tom.

>Unfortunately, none of the offered solutions are working for me

I tried, on the subform, ....

=dsum("[amounttend]","[receipts]","[description]=2")

this sums ALL records meeting the criteria in the receipts table and not
just the membership record I'm working on. If there was a way to put an
"AND" argument after the description qualifier, that might work? For
instance...

=dsum("[amounttend]","[receipts]","[description]=2" AND
"[studentid]=forms![student account data].studentid)

that might work.... is there a way?

"David Grist" <di*****@verizon.netwrote in message
news:FxQWi.71$Cc.56@trndny09...
>Hello,

Any help would be appreciated!!!

I need to sum AMOUNTTEND on a receipts subform that meet a certain
criteria.

It has to be something like.

=sum([amounttend]) where [description]="tour installment"

in other words, I want to total only the amounts when the description
field = "tour installment"

Can anyone help with the correct syntax?

Thanks,

Dave


Nov 3 '07 #7
Yes, the description was a number not text. Sorry for the bit of confusion.
"Tom van Stiphout" <no*************@cox.netwrote in message
news:8e********************************@4ax.com...
On Sat, 03 Nov 2007 19:31:52 GMT, "David Grist" <di*****@verizon.net>
wrote:

Of course you can have an AND condition. Any legal WHERE clause is
allowed.
Curious that earlier "Description" was a text field, whereas now it
appears a numeric field.
=dsum("[amounttend]","[receipts]","[description]=2 AND
[studentid]=" & forms![student account data].studentid)

-Tom.

>>Unfortunately, none of the offered solutions are working for me

I tried, on the subform, ....

=dsum("[amounttend]","[receipts]","[description]=2")

this sums ALL records meeting the criteria in the receipts table and not
just the membership record I'm working on. If there was a way to put an
"AND" argument after the description qualifier, that might work? For
instance...

=dsum("[amounttend]","[receipts]","[description]=2" AND
"[studentid]=forms![student account data].studentid)

that might work.... is there a way?

"David Grist" <di*****@verizon.netwrote in message
news:FxQWi.71$Cc.56@trndny09...
>>Hello,

Any help would be appreciated!!!

I need to sum AMOUNTTEND on a receipts subform that meet a certain
criteria.

It has to be something like.

=sum([amounttend]) where [description]="tour installment"

in other words, I want to total only the amounts when the description
field = "tour installment"

Can anyone help with the correct syntax?

Thanks,

Dave



Nov 3 '07 #8
Tom,

This is what I now have and it's still totalling all receipts in a records
of the subform.

=DSum("[amounttend]","[receipts]","Forms![Student Account
Data].[StudentID]=[StudentID]" And "[description]=2")

I want just the total of AMOUNTTEND for the current student and where the
description is equal to 2.

Can you offer any suggestions?
"Tom van Stiphout" <no*************@cox.netwrote in message
news:8e********************************@4ax.com...
On Sat, 03 Nov 2007 19:31:52 GMT, "David Grist" <di*****@verizon.net>
wrote:

Of course you can have an AND condition. Any legal WHERE clause is
allowed.
Curious that earlier "Description" was a text field, whereas now it
appears a numeric field.
=dsum("[amounttend]","[receipts]","[description]=2 AND
[studentid]=" & forms![student account data].studentid)

-Tom.

>>Unfortunately, none of the offered solutions are working for me

I tried, on the subform, ....

=dsum("[amounttend]","[receipts]","[description]=2")

this sums ALL records meeting the criteria in the receipts table and not
just the membership record I'm working on. If there was a way to put an
"AND" argument after the description qualifier, that might work? For
instance...

=dsum("[amounttend]","[receipts]","[description]=2" AND
"[studentid]=forms![student account data].studentid)

that might work.... is there a way?

"David Grist" <di*****@verizon.netwrote in message
news:FxQWi.71$Cc.56@trndny09...
>>Hello,

Any help would be appreciated!!!

I need to sum AMOUNTTEND on a receipts subform that meet a certain
criteria.

It has to be something like.

=sum([amounttend]) where [description]="tour installment"

in other words, I want to total only the amounts when the description
field = "tour installment"

Can anyone help with the correct syntax?

Thanks,

Dave



Nov 3 '07 #9
David Grist wrote:
Tom,

This is what I now have and it's still totalling all receipts in a records
of the subform.

=DSum("[amounttend]","[receipts]","Forms![Student Account
Data].[StudentID]=[StudentID]" And "[description]=2")

I want just the total of AMOUNTTEND for the current student and where the
description is equal to 2.

Can you offer any suggestions?
Maybe build a Totals query that breaks/groups on StudentID or whatever.
Then in the subform use that query and link the StudentID to StudentID
in the main form.
>
"Tom van Stiphout" <no*************@cox.netwrote in message
news:8e********************************@4ax.com...
>>On Sat, 03 Nov 2007 19:31:52 GMT, "David Grist" <di*****@verizon.net>
wrote:

Of course you can have an AND condition. Any legal WHERE clause is
allowed.
Curious that earlier "Description" was a text field, whereas now it
appears a numeric field.
=dsum("[amounttend]","[receipts]","[description]=2 AND
[studentid]=" & forms![student account data].studentid)

-Tom.
>>>Unfortunately, none of the offered solutions are working for me

I tried, on the subform, ....

=dsum("[amounttend]","[receipts]","[description]=2")

this sums ALL records meeting the criteria in the receipts table and not
just the membership record I'm working on. If there was a way to put an
"AND" argument after the description qualifier, that might work? For
instance...

=dsum("[amounttend]","[receipts]","[description]=2" AND
"[studentid]=forms![student account data].studentid)

that might work.... is there a way?

"David Grist" <di*****@verizon.netwrote in message
news:FxQWi.71$Cc.56@trndny09...

Hello,

Any help would be appreciated!!!

I need to sum AMOUNTTEND on a receipts subform that meet a certain
criteria.

It has to be something like.

=sum([amounttend]) where [description]="tour installment"

in other words, I want to total only the amounts when the description
field = "tour installment"

Can anyone help with the correct syntax?

Thanks,

Dave


Nov 3 '07 #10
if the subform is only showing records for the "current" student, then the
expression i gave you should work. where is the control that you want to
show the total?

hth
"David Grist" <di*****@verizon.netwrote in message
news:TJ4Xi.188$FO.59@trndny01...
Tom,

This is what I now have and it's still totalling all receipts in a records
of the subform.

=DSum("[amounttend]","[receipts]","Forms![Student Account
Data].[StudentID]=[StudentID]" And "[description]=2")

I want just the total of AMOUNTTEND for the current student and where the
description is equal to 2.

Can you offer any suggestions?
"Tom van Stiphout" <no*************@cox.netwrote in message
news:8e********************************@4ax.com...
On Sat, 03 Nov 2007 19:31:52 GMT, "David Grist" <di*****@verizon.net>
wrote:

Of course you can have an AND condition. Any legal WHERE clause is
allowed.
Curious that earlier "Description" was a text field, whereas now it
appears a numeric field.
=dsum("[amounttend]","[receipts]","[description]=2 AND
[studentid]=" & forms![student account data].studentid)

-Tom.

>Unfortunately, none of the offered solutions are working for me

I tried, on the subform, ....

=dsum("[amounttend]","[receipts]","[description]=2")

this sums ALL records meeting the criteria in the receipts table and not
just the membership record I'm working on. If there was a way to put an
"AND" argument after the description qualifier, that might work? For
instance...

=dsum("[amounttend]","[receipts]","[description]=2" AND
"[studentid]=forms![student account data].studentid)

that might work.... is there a way?

"David Grist" <di*****@verizon.netwrote in message
news:FxQWi.71$Cc.56@trndny09...
Hello,

Any help would be appreciated!!!

I need to sum AMOUNTTEND on a receipts subform that meet a certain
criteria.

It has to be something like.

=sum([amounttend]) where [description]="tour installment"

in other words, I want to total only the amounts when the description
field = "tour installment"

Can anyone help with the correct syntax?

Thanks,

Dave



Nov 3 '07 #11
"David Grist" <di*****@verizon.netwrote in
news:TJ4Xi.188$FO.59@trndny01:
Tom,

This is what I now have and it's still totalling all receipts in a
records of the subform.

=DSum("[amounttend]","[receipts]","Forms![Student Account
Data].[StudentID]=[StudentID]" And "[description]=2")

I want just the total of AMOUNTTEND for the current student and
where the description is equal to 2.

Can you offer any suggestions?
The quotation marks around your criteria are misplaced. Try

=DSum("[amounttend]","[receipts]","[StudentID]= " & Forms![Student
Account Data].[StudentID] & " And [description]=2")

Where studentID is a number or .

=DSum("[amounttend]","[receipts]","[StudentID]= """ & Forms![Student
Account Data].[StudentID] & """ And [description]=2")

if it is a text field.

>
"Tom van Stiphout" <no*************@cox.netwrote in message
news:8e********************************@4ax.com...
>On Sat, 03 Nov 2007 19:31:52 GMT, "David Grist"
<di*****@verizon.netwrote:

Of course you can have an AND condition. Any legal WHERE clause
is allowed.
Curious that earlier "Description" was a text field, whereas now
it appears a numeric field.
=dsum("[amounttend]","[receipts]","[description]=2 AND
[studentid]=" & forms![student account data].studentid)

-Tom.

>>>Unfortunately, none of the offered solutions are working for me

I tried, on the subform, ....

=dsum("[amounttend]","[receipts]","[description]=2")

this sums ALL records meeting the criteria in the receipts table
and not just the membership record I'm working on. If there was
a way to put an "AND" argument after the description qualifier,
that might work? For instance...

=dsum("[amounttend]","[receipts]","[description]=2" AND
"[studentid]=forms![student account data].studentid)

that might work.... is there a way?

"David Grist" <di*****@verizon.netwrote in message
news:FxQWi.71$Cc.56@trndny09...
Hello,

Any help would be appreciated!!!

I need to sum AMOUNTTEND on a receipts subform that meet a
certain criteria.

It has to be something like.

=sum([amounttend]) where [description]="tour installment"

in other words, I want to total only the amounts when the
description field = "tour installment"

Can anyone help with the correct syntax?

Thanks,

Dave





--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Nov 3 '07 #12
Tina,

This worked perfectly, as a matter of fact I created fields for all the
remaining charges and can now display them as well.

Thanks for your help!

"tina" <no****@address.comwrote in message
news:op********************@bgtnsc05-news.ops.worldnet.att.net...
if the subform is only showing records for the "current" student, then the
expression i gave you should work. where is the control that you want to
show the total?

hth
"David Grist" <di*****@verizon.netwrote in message
news:TJ4Xi.188$FO.59@trndny01...
>Tom,

This is what I now have and it's still totalling all receipts in a
records
of the subform.

=DSum("[amounttend]","[receipts]","Forms![Student Account
Data].[StudentID]=[StudentID]" And "[description]=2")

I want just the total of AMOUNTTEND for the current student and where the
description is equal to 2.

Can you offer any suggestions?
"Tom van Stiphout" <no*************@cox.netwrote in message
news:8e********************************@4ax.com.. .
On Sat, 03 Nov 2007 19:31:52 GMT, "David Grist" <di*****@verizon.net>
wrote:

Of course you can have an AND condition. Any legal WHERE clause is
allowed.
Curious that earlier "Description" was a text field, whereas now it
appears a numeric field.
=dsum("[amounttend]","[receipts]","[description]=2 AND
[studentid]=" & forms![student account data].studentid)

-Tom.
Unfortunately, none of the offered solutions are working for me

I tried, on the subform, ....

=dsum("[amounttend]","[receipts]","[description]=2")

this sums ALL records meeting the criteria in the receipts table and
not
just the membership record I'm working on. If there was a way to put
an
"AND" argument after the description qualifier, that might work? For
instance...

=dsum("[amounttend]","[receipts]","[description]=2" AND
"[studentid]=forms![student account data].studentid)

that might work.... is there a way?

"David Grist" <di*****@verizon.netwrote in message
news:FxQWi.71$Cc.56@trndny09...
Hello,

Any help would be appreciated!!!

I need to sum AMOUNTTEND on a receipts subform that meet a certain
criteria.

It has to be something like.

=sum([amounttend]) where [description]="tour installment"

in other words, I want to total only the amounts when the description
field = "tour installment"

Can anyone help with the correct syntax?

Thanks,

Dave




Nov 3 '07 #13
Tom,

Although your idea was the same as mine, it kept totalling the entire table
instead of the single record, but, another user was able to fix my issue.
Thanks for all your efforts!

- Dave

"Tom van Stiphout" <no*************@cox.netwrote in message
news:8e********************************@4ax.com...
On Sat, 03 Nov 2007 19:31:52 GMT, "David Grist" <di*****@verizon.net>
wrote:

Of course you can have an AND condition. Any legal WHERE clause is
allowed.
Curious that earlier "Description" was a text field, whereas now it
appears a numeric field.
=dsum("[amounttend]","[receipts]","[description]=2 AND
[studentid]=" & forms![student account data].studentid)

-Tom.

>>Unfortunately, none of the offered solutions are working for me

I tried, on the subform, ....

=dsum("[amounttend]","[receipts]","[description]=2")

this sums ALL records meeting the criteria in the receipts table and not
just the membership record I'm working on. If there was a way to put an
"AND" argument after the description qualifier, that might work? For
instance...

=dsum("[amounttend]","[receipts]","[description]=2" AND
"[studentid]=forms![student account data].studentid)

that might work.... is there a way?

"David Grist" <di*****@verizon.netwrote in message
news:FxQWi.71$Cc.56@trndny09...
>>Hello,

Any help would be appreciated!!!

I need to sum AMOUNTTEND on a receipts subform that meet a certain
criteria.

It has to be something like.

=sum([amounttend]) where [description]="tour installment"

in other words, I want to total only the amounts when the description
field = "tour installment"

Can anyone help with the correct syntax?

Thanks,

Dave



Nov 3 '07 #14
you're welcome :)
"David Grist" <di*****@verizon.netwrote in message
news:3s7Xi.920$lx.211@trndny05...
Tina,

This worked perfectly, as a matter of fact I created fields for all the
remaining charges and can now display them as well.

Thanks for your help!

"tina" <no****@address.comwrote in message
news:op********************@bgtnsc05-news.ops.worldnet.att.net...
if the subform is only showing records for the "current" student, then
the
expression i gave you should work. where is the control that you want to
show the total?

hth
"David Grist" <di*****@verizon.netwrote in message
news:TJ4Xi.188$FO.59@trndny01...
Tom,

This is what I now have and it's still totalling all receipts in a
records
of the subform.

=DSum("[amounttend]","[receipts]","Forms![Student Account
Data].[StudentID]=[StudentID]" And "[description]=2")

I want just the total of AMOUNTTEND for the current student and where
the
description is equal to 2.

Can you offer any suggestions?
"Tom van Stiphout" <no*************@cox.netwrote in message
news:8e********************************@4ax.com...
On Sat, 03 Nov 2007 19:31:52 GMT, "David Grist" <di*****@verizon.net>
wrote:

Of course you can have an AND condition. Any legal WHERE clause is
allowed.
Curious that earlier "Description" was a text field, whereas now it
appears a numeric field.
=dsum("[amounttend]","[receipts]","[description]=2 AND
[studentid]=" & forms![student account data].studentid)

-Tom.


Unfortunately, none of the offered solutions are working for me

I tried, on the subform, ....

=dsum("[amounttend]","[receipts]","[description]=2")

this sums ALL records meeting the criteria in the receipts table and
not
just the membership record I'm working on. If there was a way to put
an
"AND" argument after the description qualifier, that might work? For
instance...

=dsum("[amounttend]","[receipts]","[description]=2" AND
"[studentid]=forms![student account data].studentid)

that might work.... is there a way?

"David Grist" <di*****@verizon.netwrote in message
news:FxQWi.71$Cc.56@trndny09...
Hello,

Any help would be appreciated!!!

I need to sum AMOUNTTEND on a receipts subform that meet a certain
criteria.

It has to be something like.

=sum([amounttend]) where [description]="tour installment"

in other words, I want to total only the amounts when the
description
>field = "tour installment"

Can anyone help with the correct syntax?

Thanks,

Dave



Nov 4 '07 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
24760
by: Rey | last post by:
Howdy all. Appreciate your help with several problems I'm having: I'm trying to determine if the Visit subform (subformVisits) has a new record or been changed, i.e. dirty. The form that...
25
10165
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
1
8425
by: John Michael | last post by:
I have a form that has a subform that has a subform. The subform loads a record based on a combo lookup box in the main form. I'm trying to set a value in the subform based on a value in a...
4
6968
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the...
1
3028
by: MP | last post by:
I have a main form that has a subform which also has a subform: the main form is the first subform is the second subform is When I click on the button »AddNewSubSubRecord« (add a new record...
9
9667
by: Ecohouse | last post by:
I have a main form with two subforms. The first subform has the child link to the main form identity key. subform1 - Master Field: SK Child Field: TrainingMasterSK The second subform has a...
6
5937
by: DMUM via AccessMonster.com | last post by:
Hello I am trying to pass the name of my subform to a function/sub but I can't seem to get it to work. I am using an autokey function (ctrl E) to unlock text boxes on a subform. I have a few...
4
8803
by: Macbane | last post by:
Hi, I have a 'main' form called frmIssues which has a subform control (named linkIssuesDrug) containing the subform sfrmLink_Issues_Drugs. A control button on the main form opens a pop-up form...
7
12280
by: ApexData | last post by:
I am using the following code in my TabControl to manage subform loads. The code assigns the subForms SourceObject. - Do I also need code to DeAssign the SourceObject when leaving the Tab, I'm...
5
4882
by: samdev | last post by:
I have created two combo boxes in a subform.... For example 1. Combo Box State 2. Combo Box City 3. When a state from the Combo Box State is selected, the City combo box updates to reflect...
0
7103
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
7307
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
7370
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...
1
5035
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4701
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3177
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1532
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
755
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
409
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.