How do I get it to stop when the record is null instead of getting the error "invalid use of null"
Function TotalW() As Double
Dim TotalWeight As Double
Dim SWeight As Double
Dim count As Integer
Dim TWeight As Variant
Dim i As Integer
For i = 1 To 13
If Not IsEmpty(TWeight) Or IsNumeric(TWeight) Or TWeight <> Null Then
TWeight = Me("Wt" & CStr(i))
TotalWeight = TotalWeight + TWeight
MsgBox i
End If
TotalW = TotalWeight
Next i
End Function
Function TotalW() As Double
Dim TotalWeight As Double
Dim SWeight As Double
Dim count As Integer
Dim TWeight As Variant
Dim i As Integer
For i = 1 To 13
If Not IsEmpty(TWeight) Or IsNumeric(TWeight) Or TWeight <> Null Then
TWeight = Me("Wt" & CStr(i))
TotalWeight = TotalWeight + TWeight
MsgBox i
End If
TotalW = TotalWeight
Next i
End Function