Data entry question: sign reversal

johnb23

Registered User.
Local time
Today, 05:21
Joined
Mar 23, 2005
Messages
14
Is there a way to reverse the sign of a numerical field at data entry time and store the negative results...i.e. a quantity field (shipments) keyed as +100 to be stored as -100? I have tried several input mask solutions but none worked.
Thanks for any help or suggestions from an Access novice.
 
You can multiply the value times -1 in the AfterUpdate event, but I don't think this is the best solution.
It would be better to store it as a positive and change the way you subtract it from inventory, or whatever you're using it for.
 
johnb23 said:
Is there a way to reverse the sign of a numerical field at data entry time and store the negative results...i.e. a quantity field (shipments) keyed as +100 to be stored as -100? I have tried several input mask solutions but none worked.
Thanks for any help or suggestions from an Access novice.
I tried Tqty=Tqty*-1 in the After Update (as you suggested) but it didn't work...Tqty was stored as positive. Could my expression be the problem?
 
What is the data type of the underlying field?
 
What if you try on lost focus?, that way as soon as you move off of it it will change it to a positive. This is what i did when i wanted someone to put in a positive number regardless of weather it was a return or a sale, i changed it to positive, and creted a popup asking if it was a return, if they answered yes i checked the return box.

this will work only if you still want them to see the negative number, otherwise if you have a save button make it part of that save event.

Just some ideas
 
johnb23 said:
Long interger
Well that's the problem! There's no such thing as long inteRger!
LOL

Sorry I haven't gotten you any closer to the answer, as Long Interger will store a negative number.
 
Matrix_zero said:
What if you try on lost focus?, that way as soon as you move off of it it will change it to a positive. This is what i did when i wanted someone to put in a positive number regardless of weather it was a return or a sale, i changed it to positive, and creted a popup asking if it was a return, if they answered yes i checked the return box.

this will work only if you still want them to see the negative number, otherwise if you have a save button make it part of that save event.

Just some ideas
Thanks for the suggestions. I must be doing something wrong because I'v tried the expression (Tqty=Tqty* -1) in every event control in properties...nothing works. ...guess I'll have to key negatives using the - key. Thanks again.
 

Users who are viewing this thread

Back
Top Bottom