P
P_eter
I am having trouble with checking a result if it has
changed, if the value is blank, the following bombs out
on invalid use of NUll (error 94), i dont know how to
solve this.
I have the following code:
Private Sub Result_BeforeUpdate(Cancel As Integer)
Dim curNewValue As String
Dim curOriginalValue As String
Dim curChange As String
Dim strMsg As String
curNewValue = [Forms]![Result entry form]![batches
and sample Identities].[Form]![Batches & Analytes].[Form]!
[Result]
If Len([Forms]![Result entry form]![batches and
sample Identities].[Form]![Batches & Analytes].[Form]!
[Result].OldValue) < 1 Then
curOriginalValue = " "
Else
curOriginalValue = [Forms]![Result entry form]!
[batches and sample Identities].[Form]![Batches &
Analytes].[Form]![Result].OldValue
End If
If curChange <> (curOriginalValue) And
(curOriginalValue) <> " " Then
strMsg = "Change is more than 10% of original
unit price. " _
& "Restoring original unit price."
MsgBox strMsg, vbExclamation, "Invalid change."
'Forms!Products!UnitPrice = curOriginalValue
End If
End Sub
changed, if the value is blank, the following bombs out
on invalid use of NUll (error 94), i dont know how to
solve this.
I have the following code:
Private Sub Result_BeforeUpdate(Cancel As Integer)
Dim curNewValue As String
Dim curOriginalValue As String
Dim curChange As String
Dim strMsg As String
curNewValue = [Forms]![Result entry form]![batches
and sample Identities].[Form]![Batches & Analytes].[Form]!
[Result]
If Len([Forms]![Result entry form]![batches and
sample Identities].[Form]![Batches & Analytes].[Form]!
[Result].OldValue) < 1 Then
curOriginalValue = " "
Else
curOriginalValue = [Forms]![Result entry form]!
[batches and sample Identities].[Form]![Batches &
Analytes].[Form]![Result].OldValue
End If
If curChange <> (curOriginalValue) And
(curOriginalValue) <> " " Then
strMsg = "Change is more than 10% of original
unit price. " _
& "Restoring original unit price."
MsgBox strMsg, vbExclamation, "Invalid change."
'Forms!Products!UnitPrice = curOriginalValue
End If
End Sub