Results 1 to 4 of 4

Thread: Finding Just a word in a Label

  1. #1

    Thread Starter
    Member cramtheman's Avatar
    Join Date
    Dec 2000
    Posts
    43

    Exclamation

    I would like to make an If statement that looks for a certain letter or word in a label even if there are several words or letters in that label. Such as

    If txtName = (a word or letter in a label) Then

    Whatever happens(doesnt matter)
    End If

    How would I do this?
    If you need clarification just reply.

    Thanks a bundle,
    Marc
    cram
    [email protected]
    _ _ _ _ _ _ _ _ _ _ _ _ _ _
    Things to Ponder

    |Man who stands on toilet,
    Is high On pot|
    |Baseball Wrong,
    Man with four balls cannot walk|

  2. #2
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Question In a label?

    Do you mean a TextBox? or really a label?

    Try the Split() command

    ... ...
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  3. #3

    Thread Starter
    Member cramtheman's Avatar
    Join Date
    Dec 2000
    Posts
    43

    Unhappy

    I want to see if what a user typed in a text box is located in a label.

    What is the split command?

    Thanks,
    Marc
    cram
    [email protected]
    _ _ _ _ _ _ _ _ _ _ _ _ _ _
    Things to Ponder

    |Man who stands on toilet,
    Is high On pot|
    |Baseball Wrong,
    Man with four balls cannot walk|

  4. #4
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    The Split function can take a string and return an array:
    Code:
    Private Sub Form_Load
      Dim TestString as string
      Dim a() as string
      dim i as integer
    
      TestString = "This is a Test"
      a = Split(TestString)
    
      For i = lbound(a) to Ubound(a)
        MsgBox a(i)
      Next
      End
    End Sub

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