Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2003
    Posts
    106

    Unanswered: select data as its typed in a textbox

    Hi
    Can anyone help please?

    I have a textbox labelled filepath. The user can manually type in a file path.

    The Onchange event checks to see whether the path is valid (Dir method) and if the file is valid, it enables a commandbutton and writes the actual file 'name' in a box called filename.

    With me so far?

    What i would like to do if it is possible, is get the full path of the filename to appear in the filepath box as the user types. As the user types over the top of what is in there, the path should change to the path of the 'guessed' filename.

    I hope this makes more sense than it sounds! The closest analogy, is the Auto Expand function of a combo box.

    Thanks

    Dan

  2. #2
    Join Date
    Aug 2003
    Location
    Belgrade
    Posts
    68

    Re: select data as its typed in a textbox

    Instead of the Change event, you can use the KeyPress or KeyUp event of the text box to test if the path typed so far exists and to autocomplete it.

    But it will work well only if you don't have duplicate directories, which is rare, or the app will work in a specific root directory under which there are no duplicate paths. For example, if you have C:\My Documents\Docs\Word and C:\My Documents\Sheets\Excel and C:\My Documents\Access\DB, what should the text box display when the user types C:\My Doc?

  3. #3
    Join Date
    Aug 2003
    Posts
    106

    my doc

    It seems to display the first item in the directory which is fine.

    The problem i have is that it displays it in the FILENAME box.

    I would like it to display the full path in the current PATH box

    eg.

    c:\myDocuments\myPictures\Picture1.bmp
    c:\myDocuments\myPictures\Picture4.mp
    c:\myDocuments\myPictures\Picture8.mp

    If the user types in C:\my Documents\myPictures\P

    i would like the textbox they are typing into to display:

    c:\myDocuments\myPictures\Picture1.bmp

Posting Permissions

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