scouser
Registered User.
- Local time
- Today, 04:30
- Joined
- Nov 25, 2003
- Messages
- 767
I have a discount calculation field. However when I input say value 1 for 1% it adds 100% 10 = 1000% etc..... the code is as follows:
Private Sub Discount_AfterUpdate()
With Me
Dim pcnt As Integer
Dim intTot As Currency
If .Discount > 0 Then
pcnt = (.ServicePrice * .Quantity) * .Discount
.LineTotal = (.ServicePrice * .Quantity) - pcnt
Else
.LineTotal = .Quantity * .ServicePrice
End If
DoCmd.RunCommand acCmdSaveRecord
End With
intTot = DSum("LineTotal", "[tblEnquiryDetails]", "EnquiryID = Forms!frmEnquiries!EnquiryID")
If Forms!frmEnquiries!VatAdd = False Then
Forms!frmEnquiries!Total = intTot
Forms!frmEnquiries!Vat = "0"
Forms!frmEnquiries!TotalGross = intTot
Else
Forms!frmEnquiries!Total = intTot
Forms!frmEnquiries!Vat = intTot * 0.175
Forms!frmEnquiries!TotalGross = (intTot * 0.175) + intTot
End If
End Sub
Any ideas?
Cheers,
Phil.
Private Sub Discount_AfterUpdate()
With Me
Dim pcnt As Integer
Dim intTot As Currency
If .Discount > 0 Then
pcnt = (.ServicePrice * .Quantity) * .Discount
.LineTotal = (.ServicePrice * .Quantity) - pcnt
Else
.LineTotal = .Quantity * .ServicePrice
End If
DoCmd.RunCommand acCmdSaveRecord
End With
intTot = DSum("LineTotal", "[tblEnquiryDetails]", "EnquiryID = Forms!frmEnquiries!EnquiryID")
If Forms!frmEnquiries!VatAdd = False Then
Forms!frmEnquiries!Total = intTot
Forms!frmEnquiries!Vat = "0"
Forms!frmEnquiries!TotalGross = intTot
Else
Forms!frmEnquiries!Total = intTot
Forms!frmEnquiries!Vat = intTot * 0.175
Forms!frmEnquiries!TotalGross = (intTot * 0.175) + intTot
End If
End Sub
Any ideas?
Cheers,
Phil.