A formula for my table

You're not doing anything with it:

If Me.NewRecord Then
Else
txtFinalPalletCharge = txtQty * txtCurrentPalletCost
End If

If this is a new record, you don't want to do the calculation but if it is not, you do.
 
Pat,

Thanks for the new code, I still get the error message when I open the form. Here is all of the code I have for this form.

Option Compare Database
Option Explicit

Private Sub Form_BeforeInsert(Cancel As Integer)
Me.txtPalletCharges = DLookup("CurrentPalletCost", "tblPalletChargeCost")
End Sub

Private Sub Form_Current()
If Me.NewRecord Then
Else
txtFinalPalletCharge = txtQty * txtCurrentPalletCost
End If
End Sub

Private Sub Qty_AfterUpdate(Cancel As Integer)
txtFinalPalletCharge = txtQty * txtCurrentPalletCost
End Sub

I get the error message for the On Current and the Before Update, my instincts tell me that I would get it for the After Update too, but I can't get far enough in to ever know.

Thanks,
Stephanie
 

Users who are viewing this thread

Back
Top Bottom