Hello All,
This post is in continuation with the previous post which is solved now. I'm trying to check few conditions before changing the status of the defect.
Function Bug_FieldCanChange(FieldName, NewValue)
Bug_FieldCanChange = True
On Error Resume Next
If FieldName = "BG_STATUS" And NewValue = "Closed" Or NewValue = "Fixed" Then
If Bug_Fields.Field("BG_USER_05").Value = "" Then
Bug_FieldCanChange = False
msgbox "You cannot change Status to Closed or Fixed if <Field Name> is blank."
Else
Bug_FieldCanChange = True
End If
Else
Bug_FieldCanChange = True
End If
On Error GoTo 0
End FunctionWhen the fields in concern are not populated, it gives out a popup message and restricts the user from changing the field as long as the user presses 'OK' in the message box.
But if the user presses ESC, it ignores the condition and changes the status.
Can you please advice how to prevent this?
Thanks.