When I remove the outside if statement, addmessage
will create a link that will jump to the txtBillTxtSetSrc
field when clicked. Inside of the if statement the link displays
Microsoft JScript runtime error: Object expected".
It works without the if statement. Why does it not work with it?
If Me.txtBillTxtSetSrc.Text.Trim.Length > 0 Then
validateExpression = "^[BCGHJSR][0-9][0-9]"
ismatch = Regex.IsMatch((txtBillTxtSetSrc.Text).ToUpper, validateExpression)
If ismatch = False Then
tempErrorMsg = LASPBS_Classes.Errors.MainframeError.getError("281W") ' Text Set Must be B01-B99, etc.
Me.MessageCenter.addMessage(tempErrorMsg, "#", "txtBillTxtSetSrc", "form1", "E")
Me.MessageCenter.Visible = True
End If
End If