File browser that saves file name in a field (1 Viewer)

suba_ri

New member
Local time
Today, 09:03
Joined
Apr 22, 2009
Messages
6
I found this example
http://www.msaccesstips.com/2006/10/file-browser-in-msaccess.shtml
It looks pretty simple but I couldn't make it save only filename.. I don't need the full path to a file, only it's name (preferably with extension, eg. picture.jpg)
Because all my files will be in one folder and later they will be displayed on a web page..

If anyone can modify the above example to save only file name and not the full path it would be great :D

Thanks in advance
 

DCrake

Remembered
Local time
Today, 17:03
Joined
Jun 8, 2005
Messages
8,626
What you need to do is to strip out the file name form the full path and file name returned.

The easiest way to do this is to look for the last instance of a \ and take everything after that as being the file name. To do this you need to use the InStrRev() function

Code:
StrFileName = Mid(StrFileName,InStrRev(StrFileName,"\")+1)

David
 

suba_ri

New member
Local time
Today, 09:03
Joined
Apr 22, 2009
Messages
6
Thank you.. It works like a charm :D
 

suba_ri

New member
Local time
Today, 09:03
Joined
Apr 22, 2009
Messages
6
Unfortunatelly, now I have a problem again..
System administrator reinstalled OS and office and now my database doesn't work.. Browse button doesn't open anything, it just displays errors (i can look it up tomorrow, now I'm at home).. And when I try to insert common dialog control from the insert-activex controls menu I can't find it.. Like it's not installed..
And at home I have another problem, when I try to insert that control it gives me an error saying that I don't have a license..

I was reading that this task could be solved another way but I'm a total noob at programming and I couldn't adapt examples to solve my problem.
Can anyone help me with this?
I was hoping that I could solve this without using activex controls because that database is going to be used on different computers, and I just can't install needed controls on every one of them..
 

Users who are viewing this thread

Top Bottom