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. |
|
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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. |
#3
|
|||
|
|||
How to perform mathematical operations in an Access form
|
#5
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|