Access Vba Coding Run-time Error ‘438’ Multiplying A Code?

i have a project for school and keep getting Run-time error can anyone help?
Private Sub cmdCalculate_Click()
Dim InitialPrice As Double
Dim Discount As Double
Dim Tax As Double
‘Calculate Discount
Me.lblDiscount = Me.txtInitialPrice * Val(Me.txtDiscount)
(This is were my problem is)
‘Calculate SubTotal
Me.lblSubTotal = Me.txtInitialPrice – Val(Me.lblDiscount)
‘Calculate Tax
Me.lblTaxHidden = Me.txtInitialPrice * Val(Me.txtTax)
‘Calculate Final Price
Me.lblFinalPrice = Me.lblSubTotal + Val(Me.lblTaxHidden)
End Sub

Both comments and pings are currently closed.

One Response to “Access Vba Coding Run-time Error ‘438’ Multiplying A Code?”

  1. The Wanderer says:

    try this….
    Private Sub cmdCalculate_Click()
    Dim InitialPrice As Double
    Dim Discount As Double
    Dim Tax As Double
    ‘Calculate Discount
    Me.lblDiscount.Caption = Me.txtInitialPrice * Val(Me.txtDiscount)
    (This is were my problem is)
    ‘Calculate SubTotal
    Me.lblSubTotal.Caption = Me.txtInitialPrice – Val(Me.lblDiscount.Caption)
    ‘Calculate Tax
    Me.lblTaxHidden.Caption = Me.txtInitialPrice * Val(Me.txtTax)
    ‘Calculate Final Price
    Me.lblFinalPrice.Caption = Me.lblSubTotal.Caption + Val(Me.lblTaxHidden.Caption)
    End Sub
    i recreated you error and found that the solution was to use ‘.Caption’ property with the labels…
    Hope that helps….

Powered by WordPress | Designed by: free css template | Thanks to hostgator coupon and web hosting reviews