Re: how can I change all currency fields from positive to negative
- From: "Alex Dybenko" <alexdyb@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 15 Jan 2006 18:06:56 +0300
Hi,
you can do this 2 ways:
- you can store always positive values, and then use query to change Credit Memo to negative - IIF([CreditMemo], -[Line1Item], [Line1Item]) as NewLine1Item. This query you can use to calculations, etc
- you can use form's BeforeUpdate event to change Line1Item:
if [CreditMemo] then
me.Line1Item= - ABS(me.[Line1Item])
else
me.Line1Item=ABS(me.[Line1Item])
end if
assuming that CreditMemo is some Boolean flag
-- Alex Dybenko (MVP) http://alexdyb.blogspot.com http://www.PointLtd.com
"Johnie Karr" <Johnie Karr@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:8542B9A3-1B3D-451F-890D-DC6DE9967D62@xxxxxxxxxxxxxxxx
I am creating an Invoice Application for a company. They need to select
Invoice or Credit Memo. If Credit Memo is selected it should change all
values to negative, if Invoice is selected it changes all values to positive.
I have made it change all exisiting data by using: [code] Me!Line1Item = -Me!Line1Item [/code] If the value is positive this will change it to negative, and if the value is negative it will change it to positive.
2 Issues with this:
If the user manually changes that field, while Credit Memo is selected, it
will make it positive. Also, any non existant fields (ie. $0.00) are
neutral, so once edited will make them positive. Then you change Credit Memo
to Invoice and it changes the positves to negative.
There has to be a way to make the field negative, not the value of the
field. I don't know VBA, but I am using it for this program. PHP and MySQL
is where I normally develop.
Thanks,
Johnie Karr
Data Management Technologies
www.datamt.org
.
- Follow-Ups:
- Re: how can I change all currency fields from positive to negative
- From: Johnie Karr
- Re: how can I change all currency fields from positive to negative
- Prev by Date: Re: Bulk email from Access/VBA
- Next by Date: Re: Programs for OCR
- Previous by thread: Re: sending signed messages with code
- Next by thread: Re: how can I change all currency fields from positive to negative
- Index(es):
Relevant Pages
|