Summing field in Subform

S

swarfmaker

Access 2003

I have a subform, formatted as Continuous Forms, where I have the following
controls.
CourseTitle (TextBox)
Length (TextBox formatted as Integer)
Core (Check Box)
Withdrawn (Check Box)

All this works OK, showing the correct information.

I need to sum [Length] Where [Core]=True and [Withdrawn]=False in a control
in the Footer of the subform.

I've tried SUM([Length] Where [Core]=True and [Withdrawn]=False) but get
#Name

Can someone point me in the right direction

TIA
Iain
 
P

Peter Hibbs

Iain,

Base the form on a query (if you haven't already) and add a new column
to the query. In the Field: box enter :-

LengthX: IIf([Core]=True And [Withdrawn]=False,[Length],0)

In the form footer field use =SUM(LengthX)

BTW I would avoid using Length as a field name if you can as this is a
reserved word in Access.

HTH

Peter Hibbs.
 
S

swarfmaker

Peter Hibbs said:
Iain,

Base the form on a query (if you haven't already) and add a new column
to the query. In the Field: box enter :-

LengthX: IIf([Core]=True And [Withdrawn]=False,[Length],0)

In the form footer field use =SUM(LengthX)

BTW I would avoid using Length as a field name if you can as this is a
reserved word in Access.

HTH

Peter Hibbs.


Access 2003

I have a subform, formatted as Continuous Forms, where I have the
following
controls.
CourseTitle (TextBox)
Length (TextBox formatted as Integer)
Core (Check Box)
Withdrawn (Check Box)

All this works OK, showing the correct information.

I need to sum [Length] Where [Core]=True and [Withdrawn]=False in a
control
in the Footer of the subform.

I've tried SUM([Length] Where [Core]=True and [Withdrawn]=False) but get
#Name

Can someone point me in the right direction

TIA
Iain

Many thanks Peter, this works great.
This is a database I inherited, the textbox is actually [Length (hrs)]
I used to be pretty good at this stuff, but haven't touched it for some
time.
I've even still got the floppies for the first version of Access.
Regards,
Iain
 
B

boblarson

Peter:

Not sure where you came up with the word "Length" as being an Access
Reserved word. None of Microsoft's lists have that one on there:

http://support.microsoft.com/default.aspx?scid=kb;en-us;286335

http://support.microsoft.com/default.aspx?scid=kb;en-us;209187

http://support.microsoft.com/default.aspx?scid=kb;en-us;109312


--
Bob Larson
Access MVP
Access World Forums Administrator
Utter Access VIP

Tutorials at http://www.btabdevelopment.com

__________________________________


Peter Hibbs said:
Iain,

Base the form on a query (if you haven't already) and add a new column
to the query. In the Field: box enter :-

LengthX: IIf([Core]=True And [Withdrawn]=False,[Length],0)

In the form footer field use =SUM(LengthX)

BTW I would avoid using Length as a field name if you can as this is a
reserved word in Access.

HTH

Peter Hibbs.


Access 2003

I have a subform, formatted as Continuous Forms, where I have the following
controls.
CourseTitle (TextBox)
Length (TextBox formatted as Integer)
Core (Check Box)
Withdrawn (Check Box)

All this works OK, showing the correct information.

I need to sum [Length] Where [Core]=True and [Withdrawn]=False in a control
in the Footer of the subform.

I've tried SUM([Length] Where [Core]=True and [Withdrawn]=False) but get
#Name

Can someone point me in the right direction

TIA
Iain
 
D

Douglas J. Steele

Most of us consider Allen Browne's
http://www.allenbrowne.com/AppIssueBadWord.html to be the comprehensive
list, and it's not there either.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



boblarson said:
Peter:

Not sure where you came up with the word "Length" as being an Access
Reserved word. None of Microsoft's lists have that one on there:

http://support.microsoft.com/default.aspx?scid=kb;en-us;286335

http://support.microsoft.com/default.aspx?scid=kb;en-us;209187

http://support.microsoft.com/default.aspx?scid=kb;en-us;109312


--
Bob Larson
Access MVP
Access World Forums Administrator
Utter Access VIP

Tutorials at http://www.btabdevelopment.com

__________________________________


Peter Hibbs said:
Iain,

Base the form on a query (if you haven't already) and add a new column
to the query. In the Field: box enter :-

LengthX: IIf([Core]=True And [Withdrawn]=False,[Length],0)

In the form footer field use =SUM(LengthX)

BTW I would avoid using Length as a field name if you can as this is a
reserved word in Access.

HTH

Peter Hibbs.


Access 2003

I have a subform, formatted as Continuous Forms, where I have the
following
controls.
CourseTitle (TextBox)
Length (TextBox formatted as Integer)
Core (Check Box)
Withdrawn (Check Box)

All this works OK, showing the correct information.

I need to sum [Length] Where [Core]=True and [Withdrawn]=False in a
control
in the Footer of the subform.

I've tried SUM([Length] Where [Core]=True and [Withdrawn]=False) but get
#Name

Can someone point me in the right direction

TIA
Iain
 
B

boblarson

I was wondering where that list of his was and so I've now bookmarked the
page. Thanks Doug.
--
Bob Larson
Access MVP
Access World Forums Administrator
Utter Access VIP

Tutorials at http://www.btabdevelopment.com

__________________________________


Douglas J. Steele said:
Most of us consider Allen Browne's
http://www.allenbrowne.com/AppIssueBadWord.html to be the comprehensive
list, and it's not there either.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



boblarson said:
Peter:

Not sure where you came up with the word "Length" as being an Access
Reserved word. None of Microsoft's lists have that one on there:

http://support.microsoft.com/default.aspx?scid=kb;en-us;286335

http://support.microsoft.com/default.aspx?scid=kb;en-us;209187

http://support.microsoft.com/default.aspx?scid=kb;en-us;109312


--
Bob Larson
Access MVP
Access World Forums Administrator
Utter Access VIP

Tutorials at http://www.btabdevelopment.com

__________________________________


Peter Hibbs said:
Iain,

Base the form on a query (if you haven't already) and add a new column
to the query. In the Field: box enter :-

LengthX: IIf([Core]=True And [Withdrawn]=False,[Length],0)

In the form footer field use =SUM(LengthX)

BTW I would avoid using Length as a field name if you can as this is a
reserved word in Access.

HTH

Peter Hibbs.


On Sun, 20 Jul 2008 09:48:13 +0100, "swarfmaker"

Access 2003

I have a subform, formatted as Continuous Forms, where I have the
following
controls.
CourseTitle (TextBox)
Length (TextBox formatted as Integer)
Core (Check Box)
Withdrawn (Check Box)

All this works OK, showing the correct information.

I need to sum [Length] Where [Core]=True and [Withdrawn]=False in a
control
in the Footer of the subform.

I've tried SUM([Length] Where [Core]=True and [Withdrawn]=False) but get
#Name

Can someone point me in the right direction

TIA
Iain
 
P

Peter Hibbs

Bob

My mistake, I don't know what I was thinking of, perhaps I was
confusing it with Len. Just ignore me, most people do!

Peter Hibbs.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top