Common Dialog Control

sagsh

Registered User.
Local time
Today, 05:08
Joined
Jul 18, 2004
Messages
19
I have a command button on my form which runs an active X control. I use this to find files to enter into my database - however I have it set so that it opens a set directory on my machine therefore I only want to record to the database the filename not the drive name or directory. Eg test.gif and not c:\drawings\test.gif.

Does anybody know how to do this?

Thanks for any help!
Sags
 
Roughly...

Code:
Dim MyPath as string
Dim MyFile as string

MyPath = "F:\Dir1\Dir2\MyFile.Doc"
MyFile = Mid(MyPath, InStrRev(MyPath, "\") + 1)

'Test
  Debug.Print myfile

Regards,
Tim
 

Users who are viewing this thread

Back
Top Bottom