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

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
0
drb
5/24/2007 3:34:04 AM
access.forms 6864 articles. 2 followers. Follow

2 Replies
716 Views

Similar Articles

[PageSpeed] 56

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



"drb" <drburkhart@earthlink.net> wrote in message 
news:enUTaRbnHHA.4896@TK2MSFTNGP02.phx.gbl...
>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 


0
Rob
5/24/2007 4:24:20 AM
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



Rob Parker wrote:
> 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
> 
> 
> 
> "drb" <drburkhart@earthlink.net> wrote in message 
> news:enUTaRbnHHA.4896@TK2MSFTNGP02.phx.gbl...
>> 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 
> 
> 
0
drb
5/24/2007 3:50:21 PM
Reply:

Similar Artilces:

Creating a sub report with variable number of fields to print
Good morning I would like to create a report that includes a subreport. Situation: - I have a Table T1 - I created a Xtab query 1 and a Xtab query 2 to extract informations from the T1 table (sum of a field f1 by day of the week: Sun, Mon, Tue...) - I created a selection query SQ1 that grabs all the data from Xtab queries 1 and 2 (sum of a field f2 by day of the week) - Sub report is for data gathered in the selction query SQ1 My problem is that the number of fields returned by SQ1 may vary (1 week i have totals for Mon thru Fri and another week I could have sums for Mon thru Sun). I w...

bitmap display
Hi, Im developing mfc application for displaying bmp images for my university project.I donno which api will display bmp faster.I know to use Createdibitmap and LoadImage apis. I dont know which will be quick to display the image.I want to view image in any size i.e the image can be resized.So when using Createdibitmap() will it be possible to resize the image.Thanks in advance. Susi. Here are your options(any one of the following will work) 1. Use GDI+. 2. Use CStatic::SetBitmap. You are responsible for loading the bitmap and stretching it if resized. 3. Use CPictureHolder class in M...

Photo attachments no longer open correctly
This just started happening. Whenever I open a photo attachment in Outlook e-mail, MS Photo Editor opens, but its minimized. I can maximize it only, it will not restore to a partial window. What happened? ...

Adding fractions and displaying as Percentages
Hi, I have a question. I am stuck with I am trying to add a number of Fractions and then Display as a Percentage. Does anyone have a formula for this that works? 4/4 4/4 3/3 2/2 2/2 = 100% 4/4 4/4 3/4 2/2 2/2 = 94% ? Is there a way that excel can automatically calculate this? Thanks heaps Just to add to this. they are not true fractions. It is really using 4 out of 4. 3 out of 4 etc. I hope this makes sense. and that someone can help "SarahN" wrote: > Hi, > > I have a question. I am stuck with I am trying to add a number of Fract...

Printing in tiling mode
I cannot get the front to back option turned off in publisher in order to print a large size document from my HP printer Any suggestions? This I believe is a printer setting. Open Printer & Fax folder, right-click your printer, click printer preference, general tab, printing preference button, layout options, page order. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com http://officebeta.iponet.net/en-us/publisher/FX100649111033.aspx "Teresa" <Teresa@discussions.microsoft.com> wrote in message news:C0823F46-249C...

Word 2007 printing problem
I'm printing a page of labels on a color printer and they are printing in black and white. Every other Word 2007 document that I print there prints in color. Do you know what I did to the labels that would make them print in black and white? -- Janet M. Take a look at the Printer Properties in the File>Print dialog. -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP, originally posted via msnews.microsoft.com "Janet M" <JanetM@discussions.microsoft...

outlook forms #8
Stephen I need to know how you change the name of the tab/P.2 when creating an Outlook form. Also, how do you delete or create on the default message tab when creating a form. Thanks ...

Adding new record to a form
I have a form with a command button to add a new record. The first field on the form is a lookup field where I would like to select an item to fill in the field, the rest of the fields require data entry. When clicking the add record button a blank form opens but I cannot add any data to it. I can see the option in the lookup field but cannot select one. On the other fields that require data entry, I cannot enter anything. On the forms property I have 'allow additions, yes'. How can I get this to work? Bg1 - What is the recordsource for your form? If it is a query, t...

Access Report question 04-16-10
I have a data set I am building regarding our dealerships and their service capacity. There are 15 different items or so per store and 5 years of data. For certain of the data I would like to create totals in the report, not however totals for all of the different items. Is there a way to accomplish this in a report? I would like the data to layout as follows Dealer code and name 2005 2006 2007 2008 CP RO's 100 WTY RO's 125 Int RO's ...

Forms: not working right with tables.
I am not totaly good with access. The problem is: I have many tables setup and working like I need them to. This is a church project. Table 1 is linked to table two. Table one stores only address, home phone and stuff related to family's that live at the same address and table two stores names, cell phone, birthdays and stuff related to a singel person. When I create a form to enter this information it works good like a charm. The problems start with table two and three. Table three will be used to keep a recoded of the attendaince. All tables are setup and working and linked with ...

Removing Logo in X/Z Report?
v1.3 I am attempting to remove the logo from the X and Z 40 col report. In the header it says Show Logo file = True. Now if I change that to False, the whole issue should just go away, correct? Basically, I do not have a machine to test anyting on right now. Frustrating! -- Jocelyn Correct. Make sure you use the "OK" button to close all of the Reeceipt Format Property pages - not the Windows X - or your changes won't save. You will need to restart POS on each register before the change takes effect. Glenn Adams Tiber Creek Consulting http://www.tibercreek.com glenn@ti...

Printing
We are still using Dynamics 6.0. All of a sudden when we print our checks there are a couple of fields that are not showing on the stub and another appears out of order. What is strange is when I choose to print to the screen first the check looks fine. First we thought it might be the printer or the printer driver but we used a newer driver first, then just switch printers entirely and the checks were still messed up the same way. I went into the report customization screen to check the "Check with Stub on Top and Bottom - Graphical" report and it is in the modified column...

Reconcile Error Report
Explanation of the following error message: "Human Resources transaction ZZZZZZ is linked to Payroll transaction XXXXXX, and they do not match". I have looked in PartnerSource and can find no explanation regarding this message. Any ideas would be appreciated. Thank you! Don ...

Size, Rotation, and Ordering not available for forms Excel 2008
I need to align a huge number of check boxes on a form. They are considered objects, so the Size, Rotation, and Ordering option should show up on the Formatting toolbar, but it's not. So how do I align and space 1000+ checkboxes? On 5/4/10 6:05 PM, fogharty wrote: > I need to align a huge number of check boxes on a form. They are > considered objects, so the Size, Rotation, and Ordering option should > show up on the Formatting toolbar, but it's not. So how do I align and > space 1000+ checkboxes? You are correct. Size rotation and ordering is not available for ...

field references in forms
If I have a form "myform" with recordsource "mytable" and the table contains a field called "id," I can reference the current value of that field in expressions used for controls in the form by myform.id. This is true even when there is no control bound to mytable.ID on the form. I can "print" the value of myform.id in the debug immediate window. If I try the same thing for a form whose record source is a query, ? myform.id produces an error. Why the difference? And a corollary question: what's the most efficient way to test the ...

search form not to load all data up to start with
I have a form based on a query that i use to search for product in my database, on the form i have text box to type in, then a button to requery the query has the following Like "*" & [forms]![frmProductList]! [txtProductSearch] & "*" This query works fine but when i load up the form is shows all the products we stock which is a lot and seems to take a lot longer to load now, Is there a way for the form not to load up any data until o press the search button Try putting a default in [forms]![frmProductList]![txtProductSearch] that would not pro...

Displaying worksheet name in cell
Is there any way to display a worksheet name in a cell (without using macros). I have tried =MID(CELL("filename"),FIND("]",CELL("filename"))+1,255) but if I use this on multiple sheets in the same workbook, they all end up displaying the same name! Include a reference to each sheet: =MID(CELL("filename",a1),FIND("]",CELL("filename",a1))+1,255) Adrian wrote: > > Is there any way to display a worksheet name in a cell (without using macros). > > I have tried =MID(CELL("filename"),FIND("]",CELL("...

Crystal Reports Server XI: Logon to CMS
Hi group, Not sure if this should be posted here but anyway here we go: I just installed the trial of Crystal Reports Server XI, but now after the installation I had to register and after that it ask me to logon to the CMS. I need to fill in username + password and Authentication (WindowsNT, LDAP, Enterprise). I'm not sure what to do here, I tried this with my administrator account local, Domain account, I remember I had to fill in an username and pwd at the start of the installation, tried that one aswell. I can't logon to the CMS. Anyone can help me in the right Direction? Th...

Accessing Contact fields from the opportunity form
Hi This may be a basic question but I have not been able to find the answer in lots of searching...or maybe I don't know when the answer is looking me in the face..... Users would like to be able to see some of the address fields of a contact in an opportunity which relates to this contact (so they don't have to go back to look at the contact details, they appear on the opportunity form). How do I go about getting the contact details via script when I am on the opportunity form? In the same vein, I would like to be able to break the contact name into firstname and lastname so that use...

Changing just one cell each time I print
I am using Excel 2000. I need to print one sheet multiple times and change one cell on that sheet each time it prints. Example: I need to print my sheet 50 times, cells J1.J50 contain a list of numbers 001,002,003,123,456 etc. (This column does not print) I need to copy cell J1 into cell A1 - then print my worksheet, Then I need to copy cell J2 into cell A1 and print the worksheet, Then I need to copy cell J3 into cell A1 and print the worksheet You get the idea. Each time I print the worksheet I need a different number in cell A1 because I am using VLOOKUP to fill in cells in the workshe...

Ambiguous Name Detected: TmpDDE when trying to print from Outlook 2003
I have been trying to print an email attachment in Outlook with the email message (not opening the attachment). This is directly from the Inbox list (email is not open either). The error I am receiving is Ambiguous Name Detected: TmpDDE in a message box with the title Microsoft Visual Basic. any ideas would be helpful regards mark ...

Cannot print from GP
Hi We are getting following error message when user tries to print. The stored procedure glpBatchCleanup returned the following result DBMS: 0, Great Plains: 20820 We are running GP 8.0 in user workstation. This GP has worked in the past and recently error pops up. This user workstion is the following: Server: SQL Server GP version: 8.00g44 Dexterity: 8.00m079 DB server is running on MS Server 2000 8.00.760.(intel 86) also following error occurs in user workstation event log. Event Type: Error Event Source: Dexterity Event Category: None Event ID: 1000 Date: 4...

Monthly Report
Dear Freinds I am new to this world but i hope that i could get some help I Have data listed in sheet called Data as follows: DateSales ItemSold Dtl1 Dtl2 Dtl3 T-Price Quantity 01.01.2010 Item1 60 6 01.01.2010 Item2 80 4 01.01.2010 Item3 90 2 02.01.2010 Item4 100 50 02.01.2010 Item5 150 6 09.01.2010 Item6 70 2 09.01.2010 Item7 ...

Report Access not Kerberos perhaps IIS or Security
This is the Debug Info from DevErrors=On. The problem occurs when any user (except when on server itself) accesses Reports or System Settings. Any information on how to sort this much appreciated. Server Error in '/' Application. -------------------------------------------------------------------------------- The request failed with HTTP status 401: Unauthorized. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Detai...

Opening a Report
Hello, I'm new to Access and have a very basic question. I want to open a report when a user clicks a button on a form. Now since I can open a form through a button click by pasting: =OpenForms("FormName") in the "On Click" setting in the properties menu, I would assuming using: =OpenReport("ReportName") would be the trick. But it's not. Many of the examples on the net I have found use lines such as: docmd.OpenReport "rpt_name", acViewPreview, "", But when I try this I just get an error saying that the marco docmd can't be found. ...