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

Creating Expression for Sum of two fields



 
 
Thread Tools Display Modes
  #1  
Old September 29th, 2008, 06:29 PM posted to microsoft.public.access.tablesdbdesign
nirav
external usenet poster
 
Posts: 21
Default Creating Expression for Sum of two fields

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
  #2  
Old September 29th, 2008, 07:10 PM posted to microsoft.public.access.tablesdbdesign
Dale Fye
external usenet poster
 
Posts: 2,651
Default Creating Expression for Sum of two fields

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" wrote:

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

  #3  
Old September 29th, 2008, 07:24 PM posted to microsoft.public.access.tablesdbdesign
nirav
external usenet poster
 
Posts: 21
Default Creating Expression for Sum of two fields

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

Could you please help me more?

"Dale Fye" wrote:

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" wrote:

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

  #4  
Old September 29th, 2008, 09:11 PM posted to microsoft.public.access.tablesdbdesign
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Creating Expression for Sum of two fields

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" wrote:

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

Could you please help me more?

"Dale Fye" wrote:

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" wrote:

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

  #5  
Old September 29th, 2008, 09:24 PM posted to microsoft.public.access.tablesdbdesign
Dale Fye
external usenet poster
 
Posts: 2,651
Default Creating Expression for Sum of two fields

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" wrote:

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" wrote:

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

  #6  
Old September 30th, 2008, 05:26 PM posted to microsoft.public.access.tablesdbdesign
nirav
external usenet poster
 
Posts: 21
Default Creating Expression for Sum of two fields

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" wrote:

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" wrote:

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

Could you please help me more?

"Dale Fye" wrote:

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" wrote:

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

  #7  
Old September 30th, 2008, 05:35 PM posted to microsoft.public.access.tablesdbdesign
Dale Fye
external usenet poster
 
Posts: 2,651
Default Creating Expression for Sum of two fields


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" wrote:

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" wrote:

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" wrote:

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

Could you please help me more?

"Dale Fye" wrote:

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" wrote:

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

  #8  
Old September 30th, 2008, 05:51 PM posted to microsoft.public.access.tablesdbdesign
nirav
external usenet poster
 
Posts: 21
Default Creating Expression for Sum of two fields

Dear,

The formula is not working.

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

Please suggest.

"Dale Fye" wrote:


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" wrote:

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" wrote:

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" wrote:

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

Could you please help me more?

"Dale Fye" wrote:

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" wrote:

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

  #9  
Old September 30th, 2008, 07:22 PM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Creating Expression for Sum of two fields

On Tue, 30 Sep 2008 09:51:01 -0700, Nirav
wrote:

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.
--

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 08:22 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.