Looking up file names

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Anyone have a form or a good method of looking up file names “one at a time†and getting them into a field in a table. I am trying to do this for a photo image where just the name of the file is needed in a field. (I have the path to the folder in another field)
The method I am using now is finding the file in Explorer (or My Documents) then ‘rename’ on right click, then ‘Ctrl-C’ to copy the name then returning to the database window and pasting it into the field
Not exactly an automated process – nor one that I would want anyone else operating the database to use
This process is used when adding a new record, or updating a photo

I appreciate your help and advic

Ro
 
Hi,

I believe Arvin Meyer has a sample database demonstrating
this technique on his site. Look for it here:

http://www.datastrat.com/DataStrat2.html

Find PictureMgr or PictureMgr2K and download the file.
Haven't had to do this myself, but the sample file should
help you get started.

You might also try these links as well:

http://members.tripod.com/accdevel/imaging.htm

ACC2000: How to Display an Image from a Folder in a Form
or in a Report
http://support.microsoft.com/?id=210100

http://www.granite.ab.ca/access/imagehandling.htm

How about one more for good measure?

http://www.rogersaccesslibrary.com/download2k.asp?
SampleName='Pictures2k.mdb'
(Watch out for line wrapping on that link)

Jeff Conrad
Bend, Oregon

NMex Ron said:
Anyone have a form or a good method of looking up file names "one at a
time" and getting them into a field in a table. I am trying to do this for
a photo image where just the name of the file is needed in a field. (I have
the path to the folder in another field).
The method I am using now is finding the file in Explorer (or My
Documents) then 'rename' on right click, then 'Ctrl-C' to copy the name then
returning to the database window and pasting it into the field.
 
You can use the VBA Dir() function call.
You call it first with a filespec, it will return the filespec of the first
JPEG file in the SomeFolder folder
When you call it again with no filespec, inside a loop, as shown below, it
will return the filespec of the next file that meets the search spec

Dim sFileSpec As String

sFileSpec = Dir(C:\SomeFolder\*.jpg)
While(Len(sFileSpec) > 0)
Code to store the filespec
sFileSpec = Dir()
Wend

When it has found all files that meet the criteria it will return a zero
length string and fall out of the loop.

Ragnar
 
Back
Top