Copying a payment amount and placing in separate field as a minus (refund)

Coatezy

Registered User.
Local time
Today, 10:03
Joined
Jan 8, 2009
Messages
39
Hi, In my database I have a payment amount column and a refund amount column.. I also have a refund required column.. If the refund required column is set to True then I would like to take the payment amount figure (say £50.00) and then place it in the refund amount column as a minus figure (-£50.00) How would I go about doing this?

Thanks in advance! :)

Tom
 
Why have a separate column for the amount, just enter it as a negative figure in the original column and flag it as a refund
 
Problem is I would want to minus the refunded amount from the original sale.. If it changes the original sale to a refund (minus) I have nothing to refund against!? :confused: Therefore instead of subtracting £50 from £50 to leave me £0 it would leave me -£50.00. Thanks for the idea though.. Is there any way of doing my original question??

Thanks
Tom :)
 
Assuming you are using a form, then you can code the On_Click event of the checkbox related to the Refund Required field.

Do a test to see if the check box is yes or no and then set the refund amount accordingly.

Code:
Private Sub chkRefundRequired_Click()
    If Me.chkRefundRequired = -1 Then
        Me.txtRefundAmount = -Me.txtSaleAmount
    Else
        Me.txtRefundAmount = 0
    End If
End Sub
 
To turn a positive into a negative and vice verca multiply the value by -1 (minus one)

So 50*-1 = -50

This means the user can type in the value as normal then on the after update simply perform the calculation on the entry.

David
 

Users who are viewing this thread

Back
Top Bottom