Results 1 to 4 of 4

Thread: [RESOLVED] Search for a word in a text box?

  1. #1

    Thread Starter
    Lively Member feneck's Avatar
    Join Date
    Mar 2007
    Location
    Australia, Queensland, Gympie
    Posts
    85

    Resolved [RESOLVED] Search for a word in a text box?

    I no this is an easy one but...
    How do I find a word in a text box? Or more to the point, how do I check if there is a certain word in the text box?
    Thanks a whole heap...

    REMEMBER TO RATE

  2. #2
    Giants World Champs!!!! Mark Gambo's Avatar
    Join Date
    Sep 2003
    Location
    Colorado
    Posts
    2,965

    Re: Search for a word in a text box?

    Use the InStr Function:


    vb Code:
    1. If InStr(Text1.text,"Word") > 0  then
    2.     'Word was Found
    3. Else
    4.     'Word was Not Found
    5. End If
    Regards,

    Mark

    Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."


  3. #3
    Shared Member
    Join Date
    May 2005
    Location
    Kashmir, India
    Posts
    2,277

    Re: Search for a word in a text box?

    Use InStr$ Function
    Code:
        If InStr(Text1.Text, "myword") > -1 Then
            MsgBox "Found"
        End If
    Edit--
    Sorr MG, didn't see your post earlier..
    Use [code] source code here[/code] tags when you post source code.

    My Articles

  4. #4

    Thread Starter
    Lively Member feneck's Avatar
    Join Date
    Mar 2007
    Location
    Australia, Queensland, Gympie
    Posts
    85

    Re: Search for a word in a text box?

    haha thanks... lol, i feel really dumb now. but yeah. thanks guess that was one of the easy stuff i never did... hehe thanks

    REMEMBER TO RATE

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