Links to images/document

plumba

Registered User.
Local time
Today, 21:19
Joined
Apr 7, 2009
Messages
13
Hi

I have a database which contains a list of contacts. each contact has a button called 'Docs' which opens up a form for all documents received by that contact. What i would like it the 'documents' list to show just two firelds 'Type of Document' (eg, a letter 1, a letter2, a photo1), then a second field which links to that document which would be stored locally.

So, there would be a button in the document form which says 'Add New' which would ask for a description and ask you to browse to the file, then add this to the list of docs for that contact.

Not sure I've explained this clearly, but I hope you guys can help!!

Thanks in advance.
 
Suggestion:

You should use a ListView control to store you document names and links

Attached is a getfile.mdb that shows you exactly what needs to be done to get a file (open dialog).

You will need to use SHELL to open the document with its default application.

For your file type, you have to set up some sort of function to return the type of documents (.doc is word document, jpg is photo, etc...) For your purpose, maybe it is just an evaluation of the file extension.

Code:
Public Function GetFileType(byval sFileName as string) as String

    dim sFileType as String

     select case lcase(right(sFileName,4))

        case ".doc": sFileType = "Word Document"
        case ".jpg", ".tif", ".bmp": sFileType = "Photo"
        case .......

    end select

    GetFileType = sFileType

End Function

Let me (and/or the forum) know if you still need help.

-EZ
 

Attachments

Thank you both for your replies. The link to the example databse is perfect, i can incorporate the table/form into my database jusdt nicely.
Thanks for your help. My first post on this forum, very impressed with the responses.
 
I got a bit ahead of myself there. I followed the link in the post from HiTechCoach, the example database in the link works exactly how i want it to, but when i copy the code over for the buttons i get errors, it does not recognise the following two commands:

bimShellOpenFile
GetOpenFile

I get a comile error; sub or function not defined. Any ideas??
 
I got a bit ahead of myself there. I followed the link in the post from HiTechCoach, the example database in the link works exactly how i want it to, but when i copy the code over for the buttons i get errors, it does not recognise the following two commands:

bimShellOpenFile
GetOpenFile

I get a comile error; sub or function not defined. Any ideas??

There is a VBA code module that you will also need to import from my example database. Once imported, it should work for you.
 
Perfect, worked a treat after copying all the modules. Thanks a bunch, this is a sweet bit of coding!!
 
I incorporated this code over a year ago and it has worked beautifully until we started using Windows 7. I can still open up most file types, but graphics files (jpg, bmp, etc.) will no longer open.

Any ideas?

When I double click on graphics files in Windows Explorer they open up just fine (MS Paint is my default viewer and I am not sure about the default viewer for my coworkers).

Thanks for any feedback you may have!
 
MS PANTS! What decent Image Reviewing Tools do you have.

Simon
 

Users who are viewing this thread

Back
Top Bottom