Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / May 2007

Tip: Looking for answers? Try searching our database.

How display digital camera photo on form and print on report?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
drb - 24 May 2007 04:34 GMT
A client wants to add digital camera photos to a multiuser equipment
maintenance database.  I do not plan to store the photos in the .mdb,
but rather in a folder in the same location as the .mdb.  In the .mdb I
plan to store the equipment id, the path to the photo, and other fields
that will allow multiple photos of a piece of equipment on the same day
plus other fields to make the equipment id unique for each photo.

So far so good!  What object do I use to show the photo on a form?  An
unbound object frame sounds like what I want, but can't see how to
specify the path to the photo.  Where am I going wrong?  Sample code?
Once I can figure this out I should be able to use the same methods to
include the photo on a printed report.  Yes?

drb
Rob Parker - 24 May 2007 05:24 GMT
You should use an Image control to display the photo.  Here's a snippet of
code I use to display the image file for a particular record; this is placed
in the Current event of the form.  The full path/filename of the image file
is in a textbox control named txtImageFile, bound to the table field where
the path/filename is stored.  I use the same code in the AfterUpdate event
of the textbox to update the picture if the path/filename is changed.

 If Not IsNull(Me.txtImageFile) Then
   Me.imgImage.Picture = Me.txtImageFile
 Else
   Me.imgImage.Picture = ""
 End If

The same thing works in a report, except you use the Format event of the
report section which contains the image control (that's the equivalent of a
form's Current event).

And one other tip - if you set the Size Mode of the image control (it's on
the Format tab in the Properties dialog) to Zoom, your image will resize to
fit the control, and retain it's aspect ratio.

Finally, to prevent possible crashes when scrolling through records or
report pages, you should incorporate the registry changes described here:
http://www.mvps.org/access/api/api0038.htm

HTH,

Rob

>A client wants to add digital camera photos to a multiuser equipment
>maintenance database.  I do not plan to store the photos in the .mdb, but
[quoted text clipped - 10 lines]
>
> drb
drb - 24 May 2007 16:50 GMT
Thanks Rob -- I'll try your suggestions.  Somewhere I thought I read
that image control objects become part of the .mdb, that's why I was
looking at the unbound object frame.

drb

> You should use an Image control to display the photo.  Here's a snippet of
> code I use to display the image file for a particular record; this is placed
[quoted text clipped - 39 lines]
>>
>> drb
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.