Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Getting the length of a TextBox in VBA...

Getting the length of a TextBox in VBA...

Scheduled Pinned Locked Moved Database
question
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    new_phoenix
    wrote on last edited by
    #1

    How would I get the length of a textbox using VBA when there is no such code such as:

    Dim intIndex, intIndexMax As Integer
    intIndexMax = txtOutputFilePath.Length  // no such thing as txtOutputFilePath.Length
    For intIndex = intIndexMax To 0 Step -1
       // try to find the directory path and separate it from the file name by using InStr to find the last \\
    Next
    

    Does anybody have some code to separate the directory path from the directory path and file name combination? Please provide some assistance...

    P A 2 Replies Last reply
    0
    • N new_phoenix

      How would I get the length of a textbox using VBA when there is no such code such as:

      Dim intIndex, intIndexMax As Integer
      intIndexMax = txtOutputFilePath.Length  // no such thing as txtOutputFilePath.Length
      For intIndex = intIndexMax To 0 Step -1
         // try to find the directory path and separate it from the file name by using InStr to find the last \\
      Next
      

      Does anybody have some code to separate the directory path from the directory path and file name combination? Please provide some assistance...

      P Offline
      P Offline
      Paddy Boyd
      wrote on last edited by
      #2

      Use a ruler? (Or maybe something like txtOutputFilePath.Value.Length)

      N 1 Reply Last reply
      0
      • P Paddy Boyd

        Use a ruler? (Or maybe something like txtOutputFilePath.Value.Length)

        N Offline
        N Offline
        new_phoenix
        wrote on last edited by
        #3

        I think that I may not have stated my question clearly. What I meant was the length of the string value in the textbox not the width of the actual textbox as an object on the form. I tried to assign the value to a string and to check that but I cannot get the strTextBox.Length value either. Instead, I decided to use the FileDialog Common Dialog control. However, I am having some trouble retrieving values from that control as well. Please see the message above.

        B 1 Reply Last reply
        0
        • N new_phoenix

          I think that I may not have stated my question clearly. What I meant was the length of the string value in the textbox not the width of the actual textbox as an object on the form. I tried to assign the value to a string and to check that but I cannot get the strTextBox.Length value either. Instead, I decided to use the FileDialog Common Dialog control. However, I am having some trouble retrieving values from that control as well. Please see the message above.

          B Offline
          B Offline
          BrokenS
          wrote on last edited by
          #4

          new_phoenix Try: strTextBox.Text.Length ken

          1 Reply Last reply
          0
          • N new_phoenix

            How would I get the length of a textbox using VBA when there is no such code such as:

            Dim intIndex, intIndexMax As Integer
            intIndexMax = txtOutputFilePath.Length  // no such thing as txtOutputFilePath.Length
            For intIndex = intIndexMax To 0 Step -1
               // try to find the directory path and separate it from the file name by using InStr to find the last \\
            Next
            

            Does anybody have some code to separate the directory path from the directory path and file name combination? Please provide some assistance...

            A Offline
            A Offline
            anthoy
            wrote on last edited by
            #5

            Does anybody have some code to separate the directory path from the directory path and file name combination? Please provide some assistance... try using dir() like this.. dir(txtOutputFilePath.text) im using it on vb6 hope it helps you..

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups