User friendly "add image" command (1 Viewer)

Bella17

New member
Local time
Today, 02:39
Joined
May 6, 2008
Messages
1
Hi,
I have recently set up a database for a museum to archive all of our artefacts. From the main record form a user can click "Show image" which opens another form which contains a small preview of a linked (not embedded) photo stored on that computer (either bitmap or jpeg cause it's the old Access 2000 not 2003). What I would like to do is make it easier to add an image, currently I have to go into the image form on an empty record, right click on the OLE object box, choose insert image, choose browse files (making sure to click "link" so it doesn't try to embed) and then finally select a picture. I can go through the same process in the image table as well, but it needs to be a lot more user friendly! I would like to create a macro or some VBC that would allow a user to click an "add image" button in the main form that would take them straight away to browse for an image file which they could insert, and would automatically link not embed the file. I have found similar requests to this on various forums, but none had answers! Any help much appreciated.
I should probably also mention I have no experience using VBC at all, and only started using Access two weeks ago. I'm on a steep learning curve!
Thanks in advance
Bella
 

macca the hacke

Macca the Hacca
Local time
Today, 10:39
Joined
Dec 1, 2005
Messages
221
A simple but effective way is to have all the scanned documents saved in 1 folder.
You can then have a table in your database which has 2 fields - 1 contains the id of the document in your database; and the other the name of the scanned document.

You could then put some code in a module to show scanned document along the lines of:

'** code start**

Public Const DocumentFolder = "G:\Cash Management\Letters of Credit\Database\ScannedDocuments\"

Private Function set_my_link()

Dim strFileName, strFileName1 As String
strFileName = Nz(DLookup("[yourfieldname]", "[yourtablename]", "[yourtablename].[id]=" & Me![yourtextboxid]), "")
strFileName1 = DocumentFolder & strFileName & ".pdf"

'if no scanned document in table then hide button to show scanned document
If strFileName = "" Then
Me![cmd_ShowPDF].Visible = False
Else
'if there is a document then show button and set location of document
Me![cmd_ShowPDF].Visible = True
Me![cmd_ShowPDF].HyperlinkAddress = strFileName1
End If
End Function

'** code ends**


1) Setting a constant to folder where scanned documents are saved - this way you don't have to reference every time you set a path to a scanned document

If you really want scanned documents in different places then I can post some code - but a word of warning - it is long!!:)
 

Users who are viewing this thread

Top Bottom