Johnie, you have 2 fields:
- one is the dollar value;
- the other (a transaction type) indicates whether it is an Invoice or a
Credit.
How about setting up the TransactionType field as a Number field, using the
value:
1 for Invoice;
-1 for Credit Memo
(or the reverse if you prefer.)
Mark it as a Required field, and set the Validation Rule to:
1 or -1
so other values are not possible.
Then in a query, you can enter this into a fresh column in the Field row:
[TransactionType] * [Amount]
The multiplier causes one type to be positive, and the other type to be
negative.
You can use an combo box for the TransactionType, with properties:
Row Source Type Value List
Row Source 1; "Invoice"; -1; "Credit Memo"
Column Count 2
Column Widths 0
To the user, they are just selecting the type, but the multiplier does what
you need.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Johnie Karr" <Johnie
(E-Mail Removed)> wrote in message
news:8542B9A3-1B3D-451F-890D-(E-Mail Removed)...
>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
>
> 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