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 » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How to perform mathematical operations in an Access form



 
 
Thread Tools Display Modes
  #1  
Old November 3rd, 2006, 12:20 AM posted to microsoft.public.access.gettingstarted
[email protected]
external usenet poster
 
Posts: 1
Default How to perform mathematical operations in an Access form

I have been fairly successful in developing some forms. I am having
trouble getting a form to perform mathematical operations, however..
For example, a form I am trying to develop has a column where numbers
are inputted. I am trying to get the totals of these columns to appear
in a separate field. Can anyone give me some advice on this?

I have some manuals on order, but would like to get this problem solved
as soon as possible.

  #2  
Old November 3rd, 2006, 01:31 AM posted to microsoft.public.access.gettingstarted
Damian S
external usenet poster
 
Posts: 741
Default How to perform mathematical operations in an Access form

Hi,

Look into using the sum() function, or if they are unbound controls, simply
add them like this: me.CONTROL1 + me.CONTROL2 etc

Damian.

" wrote:

I have been fairly successful in developing some forms. I am having
trouble getting a form to perform mathematical operations, however..
For example, a form I am trying to develop has a column where numbers
are inputted. I am trying to get the totals of these columns to appear
in a separate field. Can anyone give me some advice on this?

I have some manuals on order, but would like to get this problem solved
as soon as possible.


  #4  
Old December 8th, 2006, 06:43 AM posted to microsoft.public.access.gettingstarted
chooriang
external usenet poster
 
Posts: 17
Default How to perform mathematical operations in an Access form

John,
I have read your previous update for this subject but I still can't figured
it out.
I have made a text box on the footer area as you mentioned before,then build
it with 'Expression Builder'
But,it still doesn't work.It asking me the parameter value for this
field',cause I don't know,I just click OK.
Then when I enter some value it doesn't make a sense.

Note:*Does it influence,my PK is set to number and It isn't a part of the
formula.
"John Vinson" wrote in message
...
On 2 Nov 2006 16:20:00 -0800, wrote:

I have been fairly successful in developing some forms. I am having
trouble getting a form to perform mathematical operations, however..
For example, a form I am trying to develop has a column where numbers
are inputted. I am trying to get the totals of these columns to appear
in a separate field. Can anyone give me some advice on this?

I have some manuals on order, but would like to get this problem solved
as soon as possible.


If you have a Continuous Form and you want to sum the values in one
field ("column"), put a textbox in the Form's Footer (make the footer
visible using the View menu option); set its Control Source property
to

=Sum([fieldname])

using the field name in the query upon which the form is based.

This sum should generally NOT be stored in any table field. Just
recalculate it as needed.

If I'm misunderstanding your structure, please post back with more
details - such as the Recordsource property of the form, what it is
that you want summed, etc.

John W. Vinson[MVP]



  #5  
Old December 9th, 2006, 03:57 PM posted to microsoft.public.access.gettingstarted
Joan Wild
external usenet poster
 
Posts: 642
Default How to perform mathematical operations in an Access form

You need to be clearer in what you want. Do you have a single column, and
you want the total at the bottom?
1
2
3
6

If you want this, what is the name of the field that holds these values?

Or do you have three columns and you want a total of the three in each row?
1 2 3 6
2 3 4 9
If you want this, what are the names of the three fields that hold the
values?

--
Joan Wild
Microsoft Access MVP

chooriang wrote:
John,
I have read your previous update for this subject but I still can't
figured it out.
I have made a text box on the footer area as you mentioned
before,then build it with 'Expression Builder'
But,it still doesn't work.It asking me the parameter value for this
field',cause I don't know,I just click OK.
Then when I enter some value it doesn't make a sense.

Note:*Does it influence,my PK is set to number and It isn't a part of
the formula.
"John Vinson" wrote in message
...
On 2 Nov 2006 16:20:00 -0800, wrote:

I have been fairly successful in developing some forms. I am having
trouble getting a form to perform mathematical operations, however..
For example, a form I am trying to develop has a column where
numbers are inputted. I am trying to get the totals of these
columns to appear in a separate field. Can anyone give me some
advice on this?

I have some manuals on order, but would like to get this problem
solved as soon as possible.


If you have a Continuous Form and you want to sum the values in one
field ("column"), put a textbox in the Form's Footer (make the footer
visible using the View menu option); set its Control Source property
to

=Sum([fieldname])

using the field name in the query upon which the form is based.

This sum should generally NOT be stored in any table field. Just
recalculate it as needed.

If I'm misunderstanding your structure, please post back with more
details - such as the Recordsource property of the form, what it is
that you want summed, etc.

John W. Vinson[MVP]



  #6  
Old December 10th, 2006, 12:45 AM posted to microsoft.public.access.gettingstarted
chooriang
external usenet poster
 
Posts: 17
Default How to perform mathematical operations in an Access form

Hi,
I have about 10 column and I want to have the total at the left hand of each
rows.
The name?.Is that important.OK just make it A - J
and then......

"Joan Wild" wrote in message
...
You need to be clearer in what you want. Do you have a single column, and
you want the total at the bottom?
1
2
3
6

If you want this, what is the name of the field that holds these values?

Or do you have three columns and you want a total of the three in each

row?
1 2 3 6
2 3 4 9
If you want this, what are the names of the three fields that hold the
values?

--
Joan Wild
Microsoft Access MVP

chooriang wrote:
John,
I have read your previous update for this subject but I still can't
figured it out.
I have made a text box on the footer area as you mentioned
before,then build it with 'Expression Builder'
But,it still doesn't work.It asking me the parameter value for this
field',cause I don't know,I just click OK.
Then when I enter some value it doesn't make a sense.

Note:*Does it influence,my PK is set to number and It isn't a part of
the formula.
"John Vinson" wrote in message
...
On 2 Nov 2006 16:20:00 -0800, wrote:

I have been fairly successful in developing some forms. I am having
trouble getting a form to perform mathematical operations, however..
For example, a form I am trying to develop has a column where
numbers are inputted. I am trying to get the totals of these
columns to appear in a separate field. Can anyone give me some
advice on this?

I have some manuals on order, but would like to get this problem
solved as soon as possible.

If you have a Continuous Form and you want to sum the values in one
field ("column"), put a textbox in the Form's Footer (make the footer
visible using the View menu option); set its Control Source property
to

=Sum([fieldname])

using the field name in the query upon which the form is based.

This sum should generally NOT be stored in any table field. Just
recalculate it as needed.

If I'm misunderstanding your structure, please post back with more
details - such as the Recordsource property of the form, what it is
that you want summed, etc.

John W. Vinson[MVP]





  #7  
Old December 10th, 2006, 03:12 PM posted to microsoft.public.access.gettingstarted
Joan Wild
external usenet poster
 
Posts: 642
Default How to perform mathematical operations in an Access form

You can add a column to the query that is the recordsource of your form.
Expr1: [A]+[b]+[C]+[D]+[E]+[F]+[G]+[H]+[i]+[J]
Add a control to your form bound to Expr1

--
Joan Wild
Microsoft Access MVP

chooriang wrote:
Hi,
I have about 10 column and I want to have the total at the left hand
of each rows.
The name?.Is that important.OK just make it A - J
and then......

"Joan Wild" wrote in message
...
You need to be clearer in what you want. Do you have a single
column, and you want the total at the bottom?
1
2
3
6

If you want this, what is the name of the field that holds these
values?

Or do you have three columns and you want a total of the three in
each row? 1 2 3 6
2 3 4 9
If you want this, what are the names of the three fields that hold
the values?

--
Joan Wild
Microsoft Access MVP

chooriang wrote:
John,
I have read your previous update for this subject but I still can't
figured it out.
I have made a text box on the footer area as you mentioned
before,then build it with 'Expression Builder'
But,it still doesn't work.It asking me the parameter value for this
field',cause I don't know,I just click OK.
Then when I enter some value it doesn't make a sense.

Note:*Does it influence,my PK is set to number and It isn't a part
of the formula.
"John Vinson" wrote in message
...
On 2 Nov 2006 16:20:00 -0800, wrote:

I have been fairly successful in developing some forms. I am
having trouble getting a form to perform mathematical operations,
however.. For example, a form I am trying to develop has a column
where numbers are inputted. I am trying to get the totals of
these columns to appear in a separate field. Can anyone give me
some advice on this?

I have some manuals on order, but would like to get this problem
solved as soon as possible.

If you have a Continuous Form and you want to sum the values in one
field ("column"), put a textbox in the Form's Footer (make the
footer visible using the View menu option); set its Control Source
property to

=Sum([fieldname])

using the field name in the query upon which the form is based.

This sum should generally NOT be stored in any table field. Just
recalculate it as needed.

If I'm misunderstanding your structure, please post back with more
details - such as the Recordsource property of the form, what it is
that you want summed, etc.

John W. Vinson[MVP]



  #8  
Old December 10th, 2006, 03:34 PM posted to microsoft.public.access.gettingstarted
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default How to perform mathematical operations in an Access form

Just in case it's possible for one or more of the underlying fields to be
Null, you might want to use

Expr1:
Nz([A],0)+Nz([b],0)+Nz([C],0)+Nz([D],0)+Nz([E],0)+Nz([F],0)+Nz([G],0)+Nz([H],0)+Nz([i],0)+Nz([J],0)


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Joan Wild" wrote in message
...
You can add a column to the query that is the recordsource of your form.
Add a control to your form bound to Expr1


--
Joan Wild
Microsoft Access MVP

chooriang wrote:
Hi,
I have about 10 column and I want to have the total at the left hand
of each rows.
The name?.Is that important.OK just make it A - J
and then......

"Joan Wild" wrote in message
...
You need to be clearer in what you want. Do you have a single
column, and you want the total at the bottom?
1
2
3
6

If you want this, what is the name of the field that holds these
values?

Or do you have three columns and you want a total of the three in
each row? 1 2 3 6
2 3 4 9
If you want this, what are the names of the three fields that hold
the values?

--
Joan Wild
Microsoft Access MVP

chooriang wrote:
John,
I have read your previous update for this subject but I still can't
figured it out.
I have made a text box on the footer area as you mentioned
before,then build it with 'Expression Builder'
But,it still doesn't work.It asking me the parameter value for this
field',cause I don't know,I just click OK.
Then when I enter some value it doesn't make a sense.

Note:*Does it influence,my PK is set to number and It isn't a part
of the formula.
"John Vinson" wrote in message
...
On 2 Nov 2006 16:20:00 -0800, wrote:

I have been fairly successful in developing some forms. I am
having trouble getting a form to perform mathematical operations,
however.. For example, a form I am trying to develop has a column
where numbers are inputted. I am trying to get the totals of
these columns to appear in a separate field. Can anyone give me
some advice on this?

I have some manuals on order, but would like to get this problem
solved as soon as possible.

If you have a Continuous Form and you want to sum the values in one
field ("column"), put a textbox in the Form's Footer (make the
footer visible using the View menu option); set its Control Source
property to

=Sum([fieldname])

using the field name in the query upon which the form is based.

This sum should generally NOT be stored in any table field. Just
recalculate it as needed.

If I'm misunderstanding your structure, please post back with more
details - such as the Recordsource property of the form, what it is
that you want summed, etc.

John W. Vinson[MVP]





  #9  
Old December 11th, 2006, 05:32 AM posted to microsoft.public.access.gettingstarted
chooriang
external usenet poster
 
Posts: 17
Default How to perform mathematical operations in an Access form

Hi,
I tough I have done everything you've said and then
When trying to execute,a message appear...
"You tried to execute a query that does not include
the specified expression 'Registration No" as a part
of an aggregate function.

Registration No is a field where the data type set to number and it's the PK
of the table.

"Joan Wild" wrote in message
...[i]
You can add a column to the query that is the recordsource of your form.
Expr1: [A]+[b]+[C]+[D]+[E]+[F]+[G]+[H]++[J]
Add a control to your form bound to Expr1

--
Joan Wild
Microsoft Access MVP

chooriang wrote:
Hi,
I have about 10 column and I want to have the total at the left hand
of each rows.
The name?.Is that important.OK just make it A - J
and then......

"Joan Wild" wrote in message
...
You need to be clearer in what you want. Do you have a single
column, and you want the total at the bottom?
1
2
3
6

If you want this, what is the name of the field that holds these
values?

Or do you have three columns and you want a total of the three in
each row? 1 2 3 6
2 3 4 9
If you want this, what are the names of the three fields that hold
the values?

--
Joan Wild
Microsoft Access MVP

chooriang wrote:
John,
I have read your previous update for this subject but I still can't
figured it out.
I have made a text box on the footer area as you mentioned
before,then build it with 'Expression Builder'
But,it still doesn't work.It asking me the parameter value for this
field',cause I don't know,I just click OK.
Then when I enter some value it doesn't make a sense.

Note:*Does it influence,my PK is set to number and It isn't a part
of the formula.
"John Vinson" wrote in message
...
On 2 Nov 2006 16:20:00 -0800, wrote:

I have been fairly successful in developing some forms. I am
having trouble getting a form to perform mathematical operations,
however.. For example, a form I am trying to develop has a column
where numbers are inputted. I am trying to get the totals of
these columns to appear in a separate field. Can anyone give me
some advice on this?

I have some manuals on order, but would like to get this problem
solved as soon as possible.

If you have a Continuous Form and you want to sum the values in one
field ("column"), put a textbox in the Form's Footer (make the
footer visible using the View menu option); set its Control Source
property to

=Sum([fieldname])

using the field name in the query upon which the form is based.

This sum should generally NOT be stored in any table field. Just
recalculate it as needed.

If I'm misunderstanding your structure, please post back with more
details - such as the Recordsource property of the form, what it is
that you want summed, etc.

John W. Vinson[MVP]





  #10  
Old December 11th, 2006, 02:33 PM posted to microsoft.public.access.gettingstarted
Joan Wild
external usenet poster
 
Posts: 642
Default How to perform mathematical operations in an Access form

Sounds like you still have a column using Sum(...) in it. Remove that and
see if it works. If you still have problems, and are willing, post the SQL
of the query (View, SQL)

--
Joan Wild
Microsoft Access MVP

chooriang wrote:[i]
Hi,
I tough I have done everything you've said and then
When trying to execute,a message appear...
"You tried to execute a query that does not include
the specified expression 'Registration No" as a part
of an aggregate function.

Registration No is a field where the data type set to number and it's
the PK of the table.

"Joan Wild" wrote in message
...
You can add a column to the query that is the recordsource of your
form. Expr1: [A]+[b]+[C]+[D]+[E]+[F]+[G]+[H]++[J]
Add a control to your form bound to Expr1

--
Joan Wild
Microsoft Access MVP

chooriang wrote:
Hi,
I have about 10 column and I want to have the total at the left hand
of each rows.
The name?.Is that important.OK just make it A - J
and then......

"Joan Wild" wrote in message
...
You need to be clearer in what you want. Do you have a single
column, and you want the total at the bottom?
1
2
3
6

If you want this, what is the name of the field that holds these
values?

Or do you have three columns and you want a total of the three in
each row? 1 2 3 6
2 3 4 9
If you want this, what are the names of the three fields that hold
the values?

--
Joan Wild
Microsoft Access MVP

chooriang wrote:
John,
I have read your previous update for this subject but I still
can't figured it out.
I have made a text box on the footer area as you mentioned
before,then build it with 'Expression Builder'
But,it still doesn't work.It asking me the parameter value for
this field',cause I don't know,I just click OK.
Then when I enter some value it doesn't make a sense.

Note:*Does it influence,my PK is set to number and It isn't a part
of the formula.
"John Vinson" wrote in
message ...
On 2 Nov 2006 16:20:00 -0800, wrote:

I have been fairly successful in developing some forms. I am
having trouble getting a form to perform mathematical
operations, however.. For example, a form I am trying to
develop has a column where numbers are inputted. I am trying
to get the totals of these columns to appear in a separate
field. Can anyone give me some advice on this?

I have some manuals on order, but would like to get this problem
solved as soon as possible.

If you have a Continuous Form and you want to sum the values in
one field ("column"), put a textbox in the Form's Footer (make
the footer visible using the View menu option); set its Control
Source property to

=Sum([fieldname])

using the field name in the query upon which the form is based.

This sum should generally NOT be stored in any table field. Just
recalculate it as needed.

If I'm misunderstanding your structure, please post back with
more details - such as the Recordsource property of the form,
what it is that you want summed, etc.

John W. Vinson[MVP]



 




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 11:38 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.