Hey Paul. Is there just the single photo file in the directory you create or
many? I would assume many.
We do something similar to what you're doing with a client of ours that
wants a paperless office. Rather than storing all of the photo information in
the database, we already know that the files for any particular investigation
are going to be in K:\Investigations\Live\Photos\ENF\XXXX where XXXX =
InvestigationID.
In this case, we simply use a list box to show the file contents of the
folder for the current investigation. All the user has to do is double-click
the file in the listbox they wish to see...or click on the file and then
click an Open File button.
In the sub below, openfile.bat simply has %1 in it, which will be the file
name you send it. Windows will use the default program to open the file,
whatever file type it is.
Private Sub cmdOpenFile_Click()
Dim ret As Integer
Dim strFile As String
On Error Resume Next
If IsNull(Me.FileList) Then
MsgBox "You did not select a file to open.", vbInformation, "No File
Selected"
Exit Sub
End If
strFile = "K:\Investigations\Live\Photos\ENF\" & Me.InvestigationID &
"\" & Me.FileList
'MsgBox Application.CodeProject.Path & "\openfile.bat " & strFile
ret = Shell("""" & Application.CodeProject.Path & "\openfile.bat"" """ &
strFile & """", vbHide)
Exit Sub
ErrorTrap:
MsgBox "Error #" & Err.Number & ": " & Err.Description, vbInformation,
"Error"
End Sub
Let me know if this helps you at all or if u need help populating the
listbox with the folder's file contents.
Ray Jefferson
Database Whiz Consulting
www.databasewhiz.com
"Paul" wrote:
> I have created a database using Access 2003: The DB has multipul table, one
> of which contains all personal information regarding a single investigation,,
> Name, Addreess etc. I have included one field to contain a hyperlink address:
> the address will always start the same: e.g K:\Investigations\Live\Photos\ENF
> ????.
> The question marks are an incrimental number. I am using Autonumber to
> generate the case file number - this is then used when creating a Folder in
> my K: directory (as above).
> When creating a new case, i require the Photo field to auto populate with
> the creating the correct unique hyperlink address relating to the correct
> file.
> I will therefore put a comand button on screen to retrieve or link to the
> file and therefore allow viewing of photos etc
> Can you help :
>
>
> ----------------
> This post is a suggestion for Microsoft, and Microsoft responds to the
> suggestions with the most votes. To vote for this suggestion, click the "I
> Agree" button in the message pane. If you do not see the button, follow this
> link to open the suggestion in the Microsoft Web-based Newsreader and then
> click "I Agree" in the message pane.
>
> http://www.microsoft.com/office/comm....modulesdaovba