2012-11-26 15 views
6

के अंदर काम नहीं कर रहा है, तो जब मैं बाहर कथन देता हूं, addmessage एक लिंक बनाएगा जो क्लिक किए जाने पर txtBillTxtSetSrc फ़ील्ड पर कूद जाएगा। अगर कथन के अंदर लिंकरनटाइम त्रुटि: ऑब्जेक्ट की उम्मीद है कि अगर किसी कथन

Microsoft JScript runtime error: Object expected".

यह कथन के बिना काम करता है। यह क्यों इसके साथ काम करता है?

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 

उत्तर

1

यह सुनिश्चित करने के लिए जांचें कि txtBillTxtSetSrc उपयोग के समय मान्य है। यदि यह कुछ भी नहीं है (शून्य) तो आप .ext संपत्ति तक पहुंच नहीं सकते हैं। अगर यह कुछ है तो यह गुणों में से एक हो सकता है। मैं उन्हें एक-एक करके जांचूंगा।

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 
संबंधित मुद्दे