Creating Expression for Sum of two fields

N

Nirav

Hi All,

I am new userof access and I am creating a for where I have two fields.

Ex. Score A (Combobox - 0, 1 or 2)
Score B (Combobox - 0, 1 or 2)

Total Score (Text Box) - (I want to create expression here so total score
automatically can be sum of score A and Score B.

Please Help
 
D

Dale Fye

I'm assuming thisis on a form?

Try putting something like the following in the ControlSource property of
the text control that you want to display the sum in:

ControlSource: = NZ([Score A), 0) + NZ([Score B), 0)

--
HTH
Dale

Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.
 
N

Nirav

Yes this is a form but formula you gave is not working.

Could you please help me more?

Dale Fye said:
I'm assuming thisis on a form?

Try putting something like the following in the ControlSource property of
the text control that you want to display the sum in:

ControlSource: = NZ([Score A), 0) + NZ([Score B), 0)

--
HTH
Dale

Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.



Nirav said:
Hi All,

I am new userof access and I am creating a for where I have two fields.

Ex. Score A (Combobox - 0, 1 or 2)
Score B (Combobox - 0, 1 or 2)

Total Score (Text Box) - (I want to create expression here so total score
automatically can be sum of score A and Score B.

Please Help
 
D

Duane Hookom

If Score A and Score B are your field names, you should be able to use:
= NZ([Score A], 0) + NZ([Score B], 0)
If this doesn't work, please come back with something more descriptive than
"is not working".

--
Duane Hookom
Microsoft Access MVP


Nirav said:
Yes this is a form but formula you gave is not working.

Could you please help me more?

Dale Fye said:
I'm assuming thisis on a form?

Try putting something like the following in the ControlSource property of
the text control that you want to display the sum in:

ControlSource: = NZ([Score A), 0) + NZ([Score B), 0)

--
HTH
Dale

Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.



Nirav said:
Hi All,

I am new userof access and I am creating a for where I have two fields.

Ex. Score A (Combobox - 0, 1 or 2)
Score B (Combobox - 0, 1 or 2)

Total Score (Text Box) - (I want to create expression here so total score
automatically can be sum of score A and Score B.

Please Help
 
D

Dale Fye

Sorry,

I dropped the right brackets "]" from the field names, should read [Score
A] and [Score B], assuming those are field names.

--
HTH
Dale

Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.



Dale Fye said:
I'm assuming thisis on a form?

Try putting something like the following in the ControlSource property of
the text control that you want to display the sum in:

ControlSource: = NZ([Score A), 0) + NZ([Score B), 0)

--
HTH
Dale

Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.



Nirav said:
Hi All,

I am new userof access and I am creating a for where I have two fields.

Ex. Score A (Combobox - 0, 1 or 2)
Score B (Combobox - 0, 1 or 2)

Total Score (Text Box) - (I want to create expression here so total score
automatically can be sum of score A and Score B.

Please Help
 
N

Nirav

Dear,

I tried this formula but it is not working. Let me explain....

My "Score A" field shows value of "2" and "Score B" field shows value of
"3", so instead of answer "5" (ex. 2+3) it gives me answer "23".

Please help.

Duane Hookom said:
If Score A and Score B are your field names, you should be able to use:
= NZ([Score A], 0) + NZ([Score B], 0)
If this doesn't work, please come back with something more descriptive than
"is not working".

--
Duane Hookom
Microsoft Access MVP


Nirav said:
Yes this is a form but formula you gave is not working.

Could you please help me more?

Dale Fye said:
I'm assuming thisis on a form?

Try putting something like the following in the ControlSource property of
the text control that you want to display the sum in:

ControlSource: = NZ([Score A), 0) + NZ([Score B), 0)

--
HTH
Dale

Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.



:

Hi All,

I am new userof access and I am creating a for where I have two fields.

Ex. Score A (Combobox - 0, 1 or 2)
Score B (Combobox - 0, 1 or 2)

Total Score (Text Box) - (I want to create expression here so total score
automatically can be sum of score A and Score B.

Please Help
 
D

Dale Fye

So, are these combo boxes bound to fields in your table, or are they
unbound? If they are bound, then what are the field names?

Assuming that you have two combo boxes, named (cboScoreA and cboScoreB)

Then try:

= val(NZ(me.cboScoreA, 0)) + val(NZ(me.cboScoreB, 0))



--
HTH
Dale

Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.



Nirav said:
Dear,

I tried this formula but it is not working. Let me explain....

My "Score A" field shows value of "2" and "Score B" field shows value of
"3", so instead of answer "5" (ex. 2+3) it gives me answer "23".

Please help.

Duane Hookom said:
If Score A and Score B are your field names, you should be able to use:
= NZ([Score A], 0) + NZ([Score B], 0)
If this doesn't work, please come back with something more descriptive than
"is not working".

--
Duane Hookom
Microsoft Access MVP


Nirav said:
Yes this is a form but formula you gave is not working.

Could you please help me more?

:

I'm assuming thisis on a form?

Try putting something like the following in the ControlSource property of
the text control that you want to display the sum in:

ControlSource: = NZ([Score A), 0) + NZ([Score B), 0)

--
HTH
Dale

Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.



:

Hi All,

I am new userof access and I am creating a for where I have two fields.

Ex. Score A (Combobox - 0, 1 or 2)
Score B (Combobox - 0, 1 or 2)

Total Score (Text Box) - (I want to create expression here so total score
automatically can be sum of score A and Score B.

Please Help
 
N

Nirav

Dear,

The formula is not working.

It says that The Object doesn't contain the Automation object 'me'.

Please suggest.

Dale Fye said:
So, are these combo boxes bound to fields in your table, or are they
unbound? If they are bound, then what are the field names?

Assuming that you have two combo boxes, named (cboScoreA and cboScoreB)

Then try:

= val(NZ(me.cboScoreA, 0)) + val(NZ(me.cboScoreB, 0))



--
HTH
Dale

Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.



Nirav said:
Dear,

I tried this formula but it is not working. Let me explain....

My "Score A" field shows value of "2" and "Score B" field shows value of
"3", so instead of answer "5" (ex. 2+3) it gives me answer "23".

Please help.

Duane Hookom said:
If Score A and Score B are your field names, you should be able to use:
= NZ([Score A], 0) + NZ([Score B], 0)
If this doesn't work, please come back with something more descriptive than
"is not working".

--
Duane Hookom
Microsoft Access MVP


:

Yes this is a form but formula you gave is not working.

Could you please help me more?

:

I'm assuming thisis on a form?

Try putting something like the following in the ControlSource property of
the text control that you want to display the sum in:

ControlSource: = NZ([Score A), 0) + NZ([Score B), 0)

--
HTH
Dale

Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.



:

Hi All,

I am new userof access and I am creating a for where I have two fields.

Ex. Score A (Combobox - 0, 1 or 2)
Score B (Combobox - 0, 1 or 2)

Total Score (Text Box) - (I want to create expression here so total score
automatically can be sum of score A and Score B.

Please Help
 
J

John W. Vinson

Dear,

The formula is not working.

It says that The Object doesn't contain the Automation object 'me'.

If this is in a Form reference rather than in VBA code, just omit the me.
 

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