CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Guest

    Strings & Textboxes!!

    i am making a program that keeps phonenumbers. i want to no if text1 or text2 has anything in it. i used this code but it doesn't seem to work:
    dim s as string
    if form2.form1 => s then
    form2.form2 = text1
    else
    form2.text1 = text1
    end if
    ' i want to go all the way to twenty textboxes
    if form2.text2 >= s then
    form2.text3 = text1
    end if

    How coem this isn't working???



  2. #2
    Join Date
    Sep 1999
    Location
    Red Wing, MN USA
    Posts
    312

    Re: Strings & Textboxes!!

    Try something like:

    If len(Text1) then
    'There's Something in Text1
    else
    'There's nothing in Text1
    End If



    If you're going to be checking 20 or so Textboxes, it may be wise to create a Control Array by setting the Index Property of Text1 to Zero and Creating 19 other Textboxes called Text1 with Indexes from 1 To 19, then you can use the Same Code to Check all the Textboxes, ie.

    for iIndex = 0 to 19
    If len(Text1(iIndex)) then
    Msgbox "Textbox " & iIndex & " Has Something In It"
    End If
    next




    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]
    Aaron Young
    Senior Programmer Analyst (Red Wing Software)
    Certified AllExperts Expert

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

Featured