Please help with if statment

  • Thread starter Thread starter tmant
  • Start date Start date
T

tmant

I have a small financial Access database.

I have a combox called 'DebitCredit' that has choices 'Debit' and 'Credit'.

There is also a 'total' field that calculates costs. What I would like to
do:

There is going to be some number(other than zero) in the 'total' field.
If the choice in the 'DebitCredit' field is 'Debit' I would like the number
(say $192) in the 'total' field to read negative, '-$192'. If the Choice in
the 'DebitCredit' field is 'Credit' then the field can remain as is '$192'.

Could someone point me in the right direction?

Thank you for taking the time to read and answer this!

T
 
Not sure I would go about it this way, but something like the following
should work:

If [debitcredit] = "debit" then
[total] = [total] * -1
end if
 
Thanks for your reply Rick! That worked! Could I ask one more question?

The 'total' field is a concatenation field and will not work using the code.
If my field 'total' is : =[Cost] + [Shipping], how would I work the code for
that?

Thanks so much for taking the time to reply!

T


Rick said:
Not sure I would go about it this way, but something like the following
should work:

If [debitcredit] = "debit" then
[total] = [total] * -1
end if



tmant said:
I have a small financial Access database.

I have a combox called 'DebitCredit' that has choices 'Debit' and 'Credit'.

There is also a 'total' field that calculates costs. What I would like to
do:

There is going to be some number(other than zero) in the 'total' field.
If the choice in the 'DebitCredit' field is 'Debit' I would like the number
(say $192) in the 'total' field to read negative, '-$192'. If the Choice in
the 'DebitCredit' field is 'Credit' then the field can remain as is '$192'.

Could someone point me in the right direction?

Thank you for taking the time to read and answer this!

T
 
Back
Top