[AccessD] Images (jpg files) on Access 2007 Report Detail Lines (Report View)

Stuart McLachlan stuart at lexacorp.com.pg
Fri Oct 7 13:59:33 CDT 2011


I do this quite regularly with a simple text field to store the filename ( usually, I keep the 
images in a standard directory, just store the filename and build the full path/filename as 
required.)

Then  I just use something like this in the report:
:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If PhotoName > "" And Dir$(PhotoDir() & PhotoName) > "" Then
   imgPhoto.Picture = PhotosDir() & PhotoName
Else
   imgPhoto.Picture = PhotosDir() & "noimage.jpg"
End If
End Sub



> 
> On Oct 7, 2011, at 12:06 PM, "Brad Marks" <BradM at blackforestltd.com>
> wrote:
> 
> > All, 
> > 
> > Earlier I posted a question about Attachment fields.  I was able to
> > find an answer to my question and I have a test application that
> > works Okay, but it seems a bit complicated for what I am trying to
> > do.
> > 
> > I thought that if I explained what I am trying to accomplish, maybe
> > someone would have some insights or suggestions.
> > 
> > I am pulling "Part" information from a SQL Server database into
> > Access 2007 via ODBC.  One of the fields in the Parts table is the
> > location of an image of the Part.  (for example  
> > C:\Part_Images\Part001.jpg).
> > 
> > I want to be able to use an Access 2007 Report (in Report View) to
> > display the appropriate .jpg file for each detail line on the
> > report.
> > 
> > I am able to accomplish this via the use of a "temporary" Access
> > table that has an Attachment field for the images.  This works, but
> > I wonder if there is a better/simpler approach.
> > 
> > I have experimented with placing an "Image" on the Report Detail
> > lines, with hopes of changing the Images's "Picture" property on the
> > fly for each detail line on the report.  I cannot figure out how to
> > do this. Perhaps Access 2007 does not allow this when using "Report
> > View".
> > 
> > I would guess that others may have run into similar situations and
> > may have some advice.
> > 
> > Thanks for your help,
> > 
> > Brad
> > 
> > -- 
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 






More information about the AccessD mailing list