Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Re: Calculated text box


Message #1 by "Darin Wray" <darin@r...> on Wed, 28 Nov 2001 08:48:44 -0600
Howdy all,



I'm needing some help in figuring out how to do a calculation in an unbound

text box.  I've got a subform on a form...data sheet view.  I put a text box

on the form.  In the subform's datasheet, there is a price column that I'd

like to add all the numbers that are showing, and have them autopopulate the

unbound text box.



Now, I tried using "sum" like this, in the text box's control source:

=Sum(forms!form2!fsubStuff!Price)



I've been reading that the running sum isn't available for use on a

form...only a report.  Is there another expression I can use?  Or, is this

something that needs to be done in code?



Darin



Message #2 by Mark Neill <mkneill@y...> on Wed, 28 Nov 2001 07:36:53 -0800 (PST)
--0-1776366501-1006961813=:9708

Content-Type: text/plain; charset=us-ascii





put brackets around you fieldnames without the sum function

=([forms]![form2]![fsubStuff]![Price])



it should work

  Darin Wray <darin@r...> wrote: Howdy all,



I'm needing some help in figuring out how to do a calculation in an unbound

text box. I've got a subform on a form...data sheet view. I put a text box

on the form. In the subform's datasheet, there is a price column that I'd

like to add all the numbers that are showing, and have them autopopulate the

unbound text box.



Now, I tried using "sum" like this, in the text box's control source:

=Sum(forms!form2!fsubStuff!Price)



I've been reading that the running sum isn't available for use on a

form...only a report. Is there another expression I can use? Or, is this

something that needs to be done in code?



Darin










Read the future with ebooks at B&N

http://service.bfast.com/bfast/click?bfmid=2181&sourceid=38934667&categoryid=rn_ebooks





---------------------------------

Do You Yahoo!?

Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.


Message #3 by "Darin Wray" <darin@r...> on Wed, 28 Nov 2001 10:26:52 -0600
This is a multi-part message in MIME format.



------=_NextPart_000_009B_01C177F7.324B2EE0

Content-Type: text/plain;

	charset="iso-8859-1"

Content-Transfer-Encoding: quoted-printable



Well, that gives me the value in the field that has focus...but lets say 

there are 3 records/fields.  I want that text box to sum up what's in 

those three fields.



Darin



  ----- Original Message -----

  From: Mark Neill

  To: Access

  Sent: Wednesday, November 28, 2001 9:36 AM

  Subject: [access] Re: Calculated text box





  put brackets around you fieldnames without the sum function



  =3D([forms]![form2]![fsubStuff]![Price])





  it should work



    Darin Wray <darin@r...> wrote:



    Howdy all,



    I'm needing some help in figuring out how to do a calculation in an 

unbound

    text box. I've got a subform on a form...data sheet view. I put a te 

xt box

    on the form. In the subform's datasheet, there is a price column 

that I'd

    like to add all the numbers that are showing, and have them 

autopopulate the

    unbound text box.



    Now, I tried using "sum" like this, in the text box's control 

source:

    =3DSum(forms!form2!fsubStuff!Price)



    I've been reading that the running sum isn't available for use on a

    form...only a report. Is there another expression I can use? Or, is 

this

    something that needs to be done in code?



    Darin








$subst('Email.Unsub')



    Read the future with ebooks at B&N

    http://service.bfast.com/bfast/click?bfm 

id=3D2181&sourceid=3D38934667&categoryid=3Drn_ebooks









-------------------------------------------------------------------------

-----

  Do You Yahoo!?

  Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. 

--- 


Read the future with ebooks at B&N 

http://service.bfast.com/bfast/click?bfmid=3D2181&sourceid=3D38934667&cat

egoryid=3Drn_ebooks






Message #4 by "Darin Wray" <darin@r...> on Wed, 28 Nov 2001 11:36:58 -0600
Hmm...don't think I've made myself clear.



There is just one price field/column.  But, for example, there are 3

records.  This is in datasheet view on the subform.



On the main form...I want a text box to give me the value of the sum of the

price fields that are visible in the subform.



Sorry for making this muddy  :)

Darin



----- Original Message -----

From: "Derrick Flores" <Derrick_Flores@s...>

To: "Access" <access@p...>

Sent: Wednesday, November 28, 2001 10:32 AM

Subject: [access] Concealed





Subject:  [access] Re: Calculated text box





=([forms]![form2]![fsubStuff]![Price]+[forms]![form2]![fsubStuff]![Price2]+[

forms]![form2]![fsubStuff]![Price3])



>>> "Darin Wray" <darin@r...> 11/28 10:26 AM >>>

Well, that gives me the value in the field that has focus...but lets say

there are 3 records/fields.  I want that text box to sum up what's in those

three fields.



Darin



  ----- Original Message -----

  From: Mark Neill

  To: Access

  Sent: Wednesday, November 28, 2001 9:36 AM

  Subject: [access] Re: Calculated text box





  put brackets around you fieldnames without the sum function



  =([forms]![form2]![fsubStuff]![Price])





  it should work



    Darin Wray <darin@r...> wrote:



    Howdy all,



    I'm needing some help in figuring out how to do a calculation in an

unbound

    text box. I've got a subform on a form...data sheet view. I put a te xt

box

    on the form. In the subform's datasheet, there is a price column that

I'd

    like to add all the numbers that are showing, and have them autopopulate

the

    unbound text box.



    Now, I tried using "sum" like this, in the text box's control source:

    =Sum(forms!form2!fsubStuff!Price)



    I've been reading that the running sum isn't available for use on a

    form...only a report. Is there another expression I can use? Or, is this

    something that needs to be done in code?



    Darin










    Read the future with ebooks at B&N

    http://service.bfast.com/bfast/click?bfm

id=2181&sourceid=38934667&categoryid=rn_ebooks









----------------------------------------------------------------------------

--

  Do You Yahoo!?

  Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. ---

You are currently subscribed to access as: darin@r... To

unsubscribe send a blank email to $subst('Email.Unsub') Read the

future with ebooks at B&N

http://service.bfast.com/bfast/click?bfmid=2181&sourceid=38934667&categoryid

=rn_ebooks







derrick_flores@s...








Read the future with ebooks at B&N

http://service.bfast.com/bfast/click?bfmid=2181&sourceid=38934667&categoryid

=rn_ebooks










Read the future with ebooks at B&N

http://service.bfast.com/bfast/click?bfmid=2181&sourceid=38934667&categoryid

=rn_ebooks



Message #5 by John Fejsa <John.Fejsa@h...> on Fri, 30 Nov 2001 08:55:40 +1100
Hi darin,



There are many ways you can use:



1) Create a query to sum all the records on the subform, filter it by 

specifying the main form relation field in the criteria (ie., [forms]![frmP

roducts]![ProductID]), and then bound the text box to the query.  This 

will sum/refresh the total in you subform every time you move from record 

to record.



2) OR use DSUM,  ie., =3DDSum("[UnitPrice]", "Products", "[ProductID] =3D 

" & Me!ProductID



3) OR update from the subform footer, ie., Me.Parent!UnboundField =3D 

Sum(Me!UnitPrice)



These are few of the many options available to you...Hope that helps.



____________________________________________________



John Fejsa

Systems Analyst/Computer Programmer

Hunter Centre for Health Advancement

Locked Bag 10

WALLSEND NSW 2287

Phone: (02) 49246 336 Fax: (02) 49246 209

____________________________________________________



The doors we open and close each day decide the lives we live

____________________________________________________



CONFIDENTIALITY & PRIVILEGE NOTICE

The information contained in this email message is intended for the named 

addressee only.  If you are not the intended recipient you must not copy, 

distribute, take any action reliant on, or disclose any details of the 

information in this email to any other person or organisation.  If you 

have received this email in error please notify us immediately.



>>> darin@r... 29/11/2001 1:48:44 >>>

Howdy all,



I'm needing some help in figuring out how to do a calculation in an 

unbound

text box.  I've got a subform on a form...data sheet view.  I put a text 

box

on the form.  In the subform's datasheet, there is a price column that I'd

like to add all the numbers that are showing, and have them autopopulate 

the

unbound text box.



Now, I tried using "sum" like this, in the text box's control source:

=3DSum(forms!form2!fsubStuff!Price)



I've been reading that the running sum isn't available for use on a

form...only a report.  Is there another expression I can use?  Or, is this

something that needs to be done in code?



Darin







.au




Read the future with ebooks at B&N

http://service.bfast.com/bfast/click?bfmid=3D2181&sourceid=3D38934667&categ

oryid=3Drn_ebooks



This message is intended for the addressee named and may contain confidential information. If you are not the intended recipient,
please delete it and notify the sender. Views expressed in this message are those of the individual sender, and are not necessarily
the views of Hunter Health.



Message #6 by "Darin Wray" <darin@r...> on Thu, 29 Nov 2001 17:26:25 -0600
Thanks for the tips.



I've actually gone about it by doing the running sum totals on each subform

(one subform per tab control)..then on the main form, having some unbound

boxes that are doing calculations on the text boxes in the subforms.  I've

got it working the way I want, now...but, I may try some of your suggestions

to compare what might be more efficient.



Again, thanks for your advice,



Darin

----- Original Message -----

From: "John Fejsa" <John.Fejsa@h...>

To: "Access" <access@p...>

Sent: Thursday, November 29, 2001 3:55 PM

Subject: [access] Re: Calculated text box





Hi darin,



There are many ways you can use:



1) Create a query to sum all the records on the subform, filter it by

specifying the main form relation field in the criteria (ie.,

[forms]![frmProducts]![ProductID]), and then bound the text box to the

query.  This will sum/refresh the total in you subform every time you move

from record to record.



2) OR use DSUM,  ie., =DSum("[UnitPrice]", "Products", "[ProductID] = " &

Me!ProductID



3) OR update from the subform footer, ie., Me.Parent!UnboundField 

Sum(Me!UnitPrice)



These are few of the many options available to you...Hope that helps.



____________________________________________________



John Fejsa

Systems Analyst/Computer Programmer

Hunter Centre for Health Advancement

Locked Bag 10

WALLSEND NSW 2287

Phone: (02) 49246 336 Fax: (02) 49246 209

____________________________________________________



The doors we open and close each day decide the lives we live

____________________________________________________



CONFIDENTIALITY & PRIVILEGE NOTICE

The information contained in this email message is intended for the named

addressee only.  If you are not the intended recipient you must not copy,

distribute, take any action reliant on, or disclose any details of the

information in this email to any other person or organisation.  If you have

received this email in error please notify us immediately.



>>> darin@r... 29/11/2001 1:48:44 >>>

Howdy all,



I'm needing some help in figuring out how to do a calculation in an unbound

text box.  I've got a subform on a form...data sheet view.  I put a text box

on the form.  In the subform's datasheet, there is a price column that I'd

like to add all the numbers that are showing, and have them autopopulate the

unbound text box.



Now, I tried using "sum" like this, in the text box's control source:

=Sum(forms!form2!fsubStuff!Price)



I've been reading that the running sum isn't available for use on a

form...only a report.  Is there another expression I can use?  Or, is this

something that needs to be done in code?



Darin







john.fejsa@h...




Read the future with ebooks at B&N

http://service.bfast.com/bfast/click?bfmid=2181&sourceid=38934667&categoryid

=rn_ebooks



This message is intended for the addressee named and may contain

confidential information. If you are not the intended recipient, please

delete it and notify the sender. Views expressed in this message are those

of the individual sender, and are not nec



essarily the views of Hunter Health.










Read the future with ebooks at B&N

http://service.bfast.com/bfast/click?bfmid=2181&sourceid=38934667&categoryid

=rn_ebooks




  Return to Index