J
jlute
With my pathetic skills I've concocted the following BeforeUpdate
event. It works except for the set to null. This generates error 2115:
"The macro or function...is preventing Access from saving the data in
the field."
Well, I don't want to save the data given the If condition! Anyone
have an idea how I can re-write this?
Thanks in advance!!!
Private Sub Weight_BeforeUpdate(Cancel As Integer)
If Len(Me!Weight & vbNullString) > 0 Then
If Len(Forms!frmPKPartitions!sfrmPKPNPhysicalAttributes.Form!
sfrmPKPNsLayoutDetails.Form!Weight & vbNullString) > 0 Then
Beep
If MsgBox("Partition can't have a Physical Attribute Weight and
a Layout Details Weight!" & vbCrLf & _
"Click OK to set to NULL.", vbOKOnly + _
vbQuestion) = vbOK Then
Me!Weight = Null
Cancel = False
DoCmd.GoToControl "WeightUOM"
End If
End If
End If
End Sub
event. It works except for the set to null. This generates error 2115:
"The macro or function...is preventing Access from saving the data in
the field."
Well, I don't want to save the data given the If condition! Anyone
have an idea how I can re-write this?
Thanks in advance!!!
Private Sub Weight_BeforeUpdate(Cancel As Integer)
If Len(Me!Weight & vbNullString) > 0 Then
If Len(Forms!frmPKPartitions!sfrmPKPNPhysicalAttributes.Form!
sfrmPKPNsLayoutDetails.Form!Weight & vbNullString) > 0 Then
Beep
If MsgBox("Partition can't have a Physical Attribute Weight and
a Layout Details Weight!" & vbCrLf & _
"Click OK to set to NULL.", vbOKOnly + _
vbQuestion) = vbOK Then
Me!Weight = Null
Cancel = False
DoCmd.GoToControl "WeightUOM"
End If
End If
End If
End Sub