Full Version: View Images in Folder as List
UtterAccess Forums > Microsoft® Access > Access Forms
Hello all.
I'm using Access 2K ADP as a front end to SQL Server. Our department is going paperless and will begin storing incoming faxes as TIF images on a network drive. The db they use will need to be transformed to view those images and assign a unique record# to it.
First things first, I need to view these image files as a list on a form - be it a list box or combo box. The folder is always the same, but the contents will change constantly.
Second, I need to select an image and marry it up to a unique record#.
Ograbbed the following code from Strive4Peace here in UA and modified it to my environment but it loops chokes on the DIR command. When I REM that line it loops ad infinitum.
How can I get the field in the form to just show a single list of the folder contents?
Welcome to Utter Access
Could you like to pick a directory and have Access a record for each image files in that directory?
then, you could have an image placeholder on a single form with the picture of the image, as well as any other fields you want to fill in...
Hi Crystal,
Thanks for replying. Here's the overview: Faxes will come in thru a fax server and eventually be saved as a TIF image on a network drive in a folder. My db will constantly look at that folder for incoming work. The images will remain on the server the whole time, I just want my db to present the contents of the folder to a clerk (data-entry person). So first I need her to see the images as a list - oldest on top of course.
When she will create a record which assigns a batch#, which all that functionality is built in already. At that time I want her to select an image from the list and have the db marry it up to the batch number as a hyperlink. I don't want to embed the image cause the db size would fast become obnoxious. So a hyperlink is the way to go which will be saved in the record. The next person in the work process then opens the batch record, clicks the hyperlink, and the image will open up for viewing and processing.
I think I know what to do for creating the link and saving it in the batch record, it's just this first step of presenting the folder contents as a list for my batch clerk. This is all currently being done via paper and now we're switching to a paperless environment, hence the need to view the images electronically.
Sorry for being so long-winded but I hope that helps you. Also, here is the code I forgot to put in my first posting which you were kind enough to provide another sorry sap ... I mean chap.
On Error GoTo error_Loop_Through_Directory_for_Listbox
Dim mPath As String, mFileMask As String, mFilename As String
Dim s As String
mPath = "c:\data\whatever\"
mFileMask = mPath & "*.xls"
Is = ""
mFilename = Dir(mFileMask)
Do While mFilename <> ""
'link to the table
if len(s) > 0 then s = s & ";"
s = s & mFilename
me.listbox_controlname.rowsource = s
on error resume next
Exit Sub
MsgBox Err.Description, , "ERROR " & Err.Number & " Loop_Through_Directory_for_Listbox"
'delete or comment next 2 lines out after code is done
here is a database for you ...
there is a form -- you BROWSE and pick a file in the directory where you want to load...
NEEDS REFERENCE to Microsoft Scripting Runtime
'Tools, References from a VBA module
In addition to the form, there is also a module you need to import into your working db -- it does run on its own, so you can test it
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.