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.
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?