Results 1 to 6 of 6

Thread: If a textbox contains " x " then

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2007
    Posts
    134

    If a textbox contains " x " then

    Is there a way to find out if a textbox contains a certain word or sentance?

    Thank you

  2. #2
    PowerPoster CDRIVE's Avatar
    Join Date
    Jul 2007
    Posts
    2,620

    Re: If a textbox contains " x " then

    Yes, the InStr function.
    <--- Did someone help you? Please rate their post. The little green squares make us feel really smart!
    If topic has been resolved, please pull down the Thread Tools & mark it Resolved.


    Is VB consuming your life, and is that a bad thing??

  3. #3

  4. #4
    Hyperactive Member Philly0494's Avatar
    Join Date
    Apr 2008
    Posts
    485

    Re: If a textbox contains " x " then

    by the way is there a way to make it so caps do not matter?

  5. #5

  6. #6
    Fanatic Member
    Join Date
    Jun 2006
    Posts
    615

    Re: If a textbox contains " x " then

    or

    Code:
    If InStr(1,Text1.Text,"X",vbTextCompare) Then
    MsgBox "The letter 'X' is in Text1!"
    End If
    That will take care of upper and lower case letters.

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