Results 1 to 3 of 3

Thread: Simple Validation not working (sample attached)

Threaded View

  1. #1

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Question Simple Validation not working (sample attached)

    In a visually inherited form, I'm doing the following:

    VB Code:
    1. Overrides Sub Textbox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
    2.         strTempVar = ""
    3.  
    4.         strTempVar = Me.TextBox1.Text
    5.  
    6.         If IsValid(strTempVar) Then
    7.             Debug.Write("valid")
    8.             Me.TextBox2.Text = strTempVar
    9.         End If
    10.  
    11.     End Sub
    12.  
    13.  
    14. Public Function IsValid(ByVal cstrTempVar As String) As Boolean
    15.         If Len(cstrTempVar) < 10 Then
    16.             IsValid = True
    17.         Else
    18.             IsValid = False
    19.  
    20.         End If
    21.     End Function

    Where textbox2 belongs to the new form only. It keeps breaking at the line:

    Me.Textbox2.Text = strTempVar

    When I move my mouse over Me.Textbox, the tooltip says Me.TextBox = Nothing

    Anyways, it's a simple application, so I've attached it. Please tell me what I'm missing.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width