PC Review


Reply
Thread Tools Rate Thread

Adding Currency?

 
 
=?Utf-8?B?Q29kZSBBZ2VudA==?=
Guest
Posts: n/a
 
      21st Jun 2006
I have 2 currency fields in a form. I also have another field that calculates
the 2 when added. the problem I am having is if I dont put info in both
fields i cant get an amount in the third.

ex. Field 1: = $25.00
Field 2 = $30.00
Field 3 = field 1 and 2 added which is $55.00

I would like to be able to have the option of only entering in Field 1 and
have Field 3 = field 1 if there is nothing in field 2, but when I decide to
put info in field 2 then field three calculates the total of field 1 and 2.

I don't know if that makes any sence but I appreciate any help.
 
Reply With Quote
 
 
 
 
fredg
Guest
Posts: n/a
 
      21st Jun 2006
On Wed, 21 Jun 2006 10:25:02 -0700, Code Agent wrote:

> I have 2 currency fields in a form. I also have another field that calculates
> the 2 when added. the problem I am having is if I dont put info in both
> fields i cant get an amount in the third.
>
> ex. Field 1: = $25.00
> Field 2 = $30.00
> Field 3 = field 1 and 2 added which is $55.00
>
> I would like to be able to have the option of only entering in Field 1 and
> have Field 3 = field 1 if there is nothing in field 2, but when I decide to
> put info in field 2 then field three calculates the total of field 1 and 2.
>
> I don't know if that makes any sence but I appreciate any help.


As control source for Control3:
=Nz([Field1]) + Nz([Field2])

Note: this value should NOT be stored in any table.
Whenever you need the result, simply re-calculate it, in a form,
report, or query.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
 
Reply With Quote
 
Chris
Guest
Posts: n/a
 
      21st Jun 2006
Try setting your field3 to the following expression:
nz(field1)+nz(field2)

the "nz" sets the fields to 0 if they are empty


"Code Agent" <(E-Mail Removed)> wrote in message
news:BA4BCBDD-FF2D-42A5-96D4-(E-Mail Removed)...
>I have 2 currency fields in a form. I also have another field that
>calculates
> the 2 when added. the problem I am having is if I dont put info in both
> fields i cant get an amount in the third.
>
> ex. Field 1: = $25.00
> Field 2 = $30.00
> Field 3 = field 1 and 2 added which is $55.00
>
> I would like to be able to have the option of only entering in Field 1 and
> have Field 3 = field 1 if there is nothing in field 2, but when I decide
> to
> put info in field 2 then field three calculates the total of field 1 and
> 2.
>
> I don't know if that makes any sence but I appreciate any help.



 
Reply With Quote
 
=?Utf-8?B?Q29kZSBBZ2VudA==?=
Guest
Posts: n/a
 
      21st Jun 2006
Thanks for your replies and correct answers. It works perfectly!

"Chris" wrote:

> Try setting your field3 to the following expression:
> nz(field1)+nz(field2)
>
> the "nz" sets the fields to 0 if they are empty
>
>
> "Code Agent" <(E-Mail Removed)> wrote in message
> news:BA4BCBDD-FF2D-42A5-96D4-(E-Mail Removed)...
> >I have 2 currency fields in a form. I also have another field that
> >calculates
> > the 2 when added. the problem I am having is if I dont put info in both
> > fields i cant get an amount in the third.
> >
> > ex. Field 1: = $25.00
> > Field 2 = $30.00
> > Field 3 = field 1 and 2 added which is $55.00
> >
> > I would like to be able to have the option of only entering in Field 1 and
> > have Field 3 = field 1 if there is nothing in field 2, but when I decide
> > to
> > put info in field 2 then field three calculates the total of field 1 and
> > 2.
> >
> > I don't know if that makes any sence but I appreciate any help.

>
>
>

 
Reply With Quote
 
Joseph Meehan
Guest
Posts: n/a
 
      21st Jun 2006
Code Agent wrote:
> I have 2 currency fields in a form. I also have another field that
> calculates the 2 when added. the problem I am having is if I dont put
> info in both fields i cant get an amount in the third.
>
> ex. Field 1: = $25.00
> Field 2 = $30.00
> Field 3 = field 1 and 2 added which is $55.00
>
> I would like to be able to have the option of only entering in Field
> 1 and have Field 3 = field 1 if there is nothing in field 2, but when
> I decide to put info in field 2 then field three calculates the total
> of field 1 and 2.
>
> I don't know if that makes any sence but I appreciate any help.


Are you sure you want to store that total in a field? Normally in
Access you would not store it, rather you would compute it and display it as
needed in a form, report or query.

The problem would come up if one of the values were changed (corrected)
the total would then be in error, also Access likes computing values better
than looking them up. On the other hand if you want to retain the original
total even if one of the components changes, then that should be stored; use
the procedure someone has already provided.


--
Joseph Meehan

Dia duit


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding currency fields together =?Utf-8?B?Z2RhcyBhdXN0cmFsaWE=?= Microsoft Access Queries 6 8th Oct 2007 05:24 AM
Adding negative currency automatically quetzalc0atl@hotmail.com Microsoft Excel Programming 3 10th Oct 2006 12:20 PM
Problem adding currency in VB6 Steven Smith Microsoft VB .NET 5 16th May 2006 05:13 AM
adding currency in a form =?Utf-8?B?ZGNocmlzdG8=?= Microsoft Access Forms 1 14th Jun 2005 06:00 PM
adding 2 columns of currency =?Utf-8?B?TWljaGVsZQ==?= Microsoft Excel Misc 0 20th Oct 2004 04:55 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:47 AM.