Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Mar 2004
    Location
    Knoxville, Tennessee, USA
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    TextBox Question (VB6)

    I have a program in which it is necessary to take a sentence contained in one TextBox and transfer it to another TextBox. That I can do with no problem. However, I also need to change the case of the first word of the sentence from Uppercase to Lowercase. I can change the case of the entire sentence, but have not figured out how to change the case of just the first word.

    I have spent many hours on this and would greatly appreciate any guidance! Thank you!

    Bob

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: TextBox Question (VB6)

    Assuming that there is a space after the first word, you can use

    Dim intPos As Integer
    intPos = Instr(TextBox1, " ")
    TextBox2 = LCase(Left(TextBox1, intPos - 1)) & Mid(TextBox1, intPos)

    with the appropriate names substituted.

  3. #3
    New Lounger
    Join Date
    Mar 2004
    Location
    Knoxville, Tennessee, USA
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: TextBox Question (VB6)

    Thank you Hans!

  4. #4
    New Lounger
    Join Date
    Mar 2004
    Location
    Knoxville, Tennessee, USA
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: TextBox Question (VB6)

    Dear Hans:

    I apologize if I am breaching any Message Board Protocol by asking you a different question within this post. In fact it is a simplified version of a question answered by one of the other participants, but I cannot get his code to work. I am sure it is me not his Code. If it is not all ready obvious I am not a computer programmer. I am an attorney with limited experience in VB6. Even with my limited experience, I have noticed that you are by far the most knoweldgeable person on this site.

    What I need to do first is merely insert textbox data found in Text1.Text from a VB6 form and insert it into cell C3 contained on Sheet1 of Book1 in Excel (found at C:Book1.xls). If I can do that, then I can build upon it. Any help you can give would be appreciated more than you can imagine. Thank you! Bob

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: TextBox Question (VB6)

    This is not the appropriate thread. I will post a reply in the thread about populating an Excel cell.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •