?
Solved

Insert .jpg into an access report

Posted on 2012-08-21
9
Medium Priority
?
834 Views
Last Modified: 2012-08-22
Using Access 2010, I want to have a report place .jpg images into a field in a report.

The file and path for the .jpg file is stored in a text field in the report's table.

It works great in a form, but seems more difficult to implement in a report

Thanks
0
Comment
Question by:rogerdjr
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 40

Assisted Solution

by:als315
als315 earned 800 total points
ID: 38319095
You can use example from my article (Images on continuous forms). There is no difference between form and report in this case.
ImagesTest.zip
0
 
LVL 31

Assisted Solution

by:hnasr
hnasr earned 800 total points
ID: 38320188
Try this:
Image control record source: =[currentproject].[Path] & "\" & [ImagePath]
ImagesTest-2.zip
0
 

Author Comment

by:rogerdjr
ID: 38320677
Both solutions work great

One clarification - when there is no image I want the image box to disappear and the report to compress

I tried both on_print and on_format with this code and neither worked?

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    If Len(Trim(Me![CheckListFigureRef])) > 1 Then
        Me![CASpRptImage01].Visible = -1
    Else
        Me![CASpRptImage01].Visible = 0
    End If
End Sub
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 400 total points
ID: 38320904
The LEN() function is not always best to check for "missing" values, ...try this instead:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    If Not Isnull(Me![CheckListFigureRef]) Then
        Me![CASpRptImage01].Visible = -1
    Else
        Me![CASpRptImage01].Visible = 0
    End If
End Sub
0
 
LVL 40

Accepted Solution

by:
als315 earned 800 total points
ID: 38321128
@hnasr: in my sample field's default value on a form =[CurrentProject].[Path] :)
0
 
LVL 31

Assisted Solution

by:hnasr
hnasr earned 800 total points
ID: 38321143
check this:
Use the Dir function
ImagesTest-3.zip
0
 

Author Closing Comment

by:rogerdjr
ID: 38321674
Thanks for the quick response
0
 
LVL 31

Expert Comment

by:hnasr
ID: 38321767
Welcome!
0
 
LVL 31

Expert Comment

by:hnasr
ID: 38322464
My comments revisited: To display

Form_Load
Report_Load

     Me.Image.Picture = [CurrentProject].Path & "\" & "NA.jpg"

Removed code in Report Detail_Format.
0

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question