IF STATEMENT

  • Thread starter Thread starter Hendrix
  • Start date Start date
H

Hendrix

I am trying to set up a field in access that is dependent on another
field.

current field in my table are "Amt" and "D/C"

I will like to add a field that say if D/C = "C" then Amt * -1

Can some on help me with this?
 
Where are you entering the data? You will have to use a form for this and
the After Update event of the control that the D/C field is bound to. Also,
I would recommend changing the name of the D/C field. If you don't enclose
every reference to it in brackets [D/C] it will cause you problems.
 
how would I do that?

I was planning on adding a field to the new field to an existing table
and running an update query to populate it. I can't do it that way?

Where are you entering the data? You will have to use a form for this and
the After Update event of the control that the D/C field is bound to.  Also,
I would recommend changing the name of the D/C field.  If you don't enclose
every reference to it in brackets [D/C] it will cause you problems.




I am trying to set up a field in access that is dependent on another
field.
current field in my table are "Amt" and "D/C"
I will like to add a field that say if D/C = "C" then Amt * -1
Can some on help me with this?- Hide quoted text -

- Show quoted text -
 
You do it in a query, not in a table.
Correct_Amt: IIF([D/C] = "C", [Amt] * -1, [Amt])
 
Would I do this in a regular query or an update query?

You do it in a query, not in a table.
   Correct_Amt:  IIF([D/C] = "C", [Amt] * -1, [Amt])

--
Build a little, test a little.



Hendrix said:
I am trying to set up a field in access that is dependent on another
field.
current field in my table are "Amt" and "D/C"
I will like to add a field that say if D/C = "C" then Amt * -1
Can some on help me with this?
.- Hide quoted text -

- Show quoted text -
 
Would I do this in a regular query or an update query?
In a regular query to be used in a report.
--
Build a little, test a little.


Hendrix said:
Would I do this in a regular query or an update query?

You do it in a query, not in a table.
Correct_Amt: IIF([D/C] = "C", [Amt] * -1, [Amt])

--
Build a little, test a little.



Hendrix said:
I am trying to set up a field in access that is dependent on another
field.
current field in my table are "Amt" and "D/C"
I will like to add a field that say if D/C = "C" then Amt * -1
Can some on help me with this?
.- Hide quoted text -

- Show quoted text -

.
 
Back
Top