Forcing data to be a negative number

  • Thread starter Thread starter L.A. Lawyer
  • Start date Start date
L

L.A. Lawyer

I am putting client payments in the same field as their bills.

Thus, I need to force payments, entered on a form, to be saved as a negative
number, no matter what.

I assume that some of the people entering the data will enter it as a
negative number and I need to insure that it is always negative.

How is that done?
 
hi,

L.A. Lawyer said:
I assume that some of the people entering the data will enter it as a
negative number and I need to insure that it is always negative.
Use the forms Before Update event, e.g. something like:

Private Sub Form_BeforeUpdate(Cancel As Integer)

If IsNumeric(txtPayment.Value) Then
txtPayment.Value = -Abs(txtPayment.Value)
End If

End Sub



mfG
--> stefan <--
 
How about validating the input and multiply that by -1 that should give you a
negative number. I don't know the setup but you could check in the before
update of the form. Check the textbox which holds the number and apply the
multiplier.
 
Back
Top