Results 1 to 5 of 5

Thread: Content in a textbox [RESOLVED]

  1. #1

    Thread Starter
    Fanatic Member LITHIA's Avatar
    Join Date
    Dec 2002
    Location
    UK, England
    Posts
    575

    Content in a textbox [RESOLVED]

    How do you find out if you got a certain phrase in a textbox regardless of what else you have in it?

    Like, if the textbox contains 'save' anywherfe in it, so the string may be 'comon save for me pls' it will find the 'save' inside it and do whatever i want next?

    Thanks, appreciated
    Last edited by LITHIA; Nov 12th, 2003 at 03:40 PM.

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    VB Code:
    1. InStr(Text1.Text, "save")

  3. #3
    Try using something like this:
    VB Code:
    1. If InStr(1, Text1.Text,"Save") >0 then
    2.       'Events to happen here
    3. End if

  4. #4
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    This will yield non case sensitive too
    VB Code:
    1. If InStr(1, Text1.Text, "SaVe", vbTextCompare) <> 0 Then
    2.         'Item found
    3.         MsgBox "Match!"
    4.     End If

  5. #5

    Thread Starter
    Fanatic Member LITHIA's Avatar
    Join Date
    Dec 2002
    Location
    UK, England
    Posts
    575
    hey thanks very much everybody! Works great, and the non case sensitive thing is handy - thanks

    Resolved

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