Browse Button passing Path & Filename

TeneQuodBene

New member
Local time
Today, 20:59
Joined
Nov 20, 2003
Messages
9
Hi,

First of all, I'm not so familiar with VBA and stuff.
But I've managed to get a browse button (to select images) fully working on my form. The entire path OR only the filename are passed through a textfield (see Microsoft KB 303066).

My question :
Is it possible to retrieve the filename in one textfield and the entire path(+filename) in another textfield?
eg : textfield1 = summer.jpg
textfield2 = c:\images\summer.jpg

Thanks in advance,
TeneQuodBene
 
If you have the entire path and filename, here's a function to extract just the filename:
Code:
Function GetFileName(strFullname As String) 

  Do Until (InStr(strFullname, "\")) = 0 
    strFullname = Right(strFullname, Len(strFullname) - (InStr(strFullname, "\"))) 
  Loop 

  GetFileName = strFullname 

End Function
Credit goes to Daxton A for coming up with it.
 
Thank U very much, this helped me a lot.

TeneQuodBene
 

Users who are viewing this thread

Back
Top Bottom