Results 1 to 4 of 4

Thread: InStr Question

  1. #1

    Thread Starter
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Just curious on this:
    Code:
    private sub command1_click
    if instr(text1, "test") then
        MsgBox"It's in"
    end if
    If i type in the text box, "testing" it returns true. Am I forgeting something.

  2. #2
    Hyperactive Member
    Join Date
    Nov 2000
    Location
    Mexico City
    Posts
    306
    Of course!!!
    "test" is in fact part of "testing"
    What´s the problem?
    If things were easy, users might be programmers.

  3. #3
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Code:
    'to check for entire word
    Private Sub command1_click()
      If Text1 Like "*testing" Then MsgBox "It's In"
    End Sub
    [Edited by HeSaidJoe on 12-06-2000 at 12:48 PM]
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  4. #4

    Thread Starter
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    thanks HeSaid, I dont know what I was thinkin', brain lock. jp, what I was looking for was an occurence of test, the actual word, not testing. I just got a little confused

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