to make sure txtBillTxtSetSrc is valid during use. If it is Nothing (null), you cannot access the .Text property and so on. Also, if this is something, this may be one of the properties. I would check them out alone.
If Not (Me.txtBillTxtSetSrc is Nothing) andalso (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
source share