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 Programming / May 2008

Tip: Looking for answers? Try searching our database.

Image references

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
paul bennett - 22 May 2008 12:16 GMT
I have a large number of photos linked to display in a report and a form.
This is set up so that the image frame will look for the appropriate file
without incorporating it as an OLE object:

'define the photo file name'
Dim thePhotoPath1 As String
thePhotoPath1 = theDbFolder & "GazetteerMaps\" & theSite & ".jpg"
Dim thePhotoPath2 As String
thePhotoPath2 = theDbFolder & "GazetteerPhotos\" & theSite & ".jpg"

'set each image frame to contain a photo
Me.ImgPhoto1.Picture = thePhotoPath1
Me.ImgPhoto2.Picture = thePhotoPath2

Presently, there needs to be a file for every site, or I get an error
message to debug. Is there some code that will tell the image frame
(ImgPhoto1 and 2) to display a default image or to simply not display in the
event of a photo not being present?
John Smith - 22 May 2008 17:53 GMT
Use the Dir command:

If Dir(thePhotoPath1) = "" Then
  ' Do whatever you wish when there is no file
Else
  Me.ImgPhoto1.Picture = thePhotoPath1
End If

HTH
John
##################################
Don't Print - Save trees

> I have a large number of photos linked to display in a report and a form.
> This is set up so that the image frame will look for the appropriate file
[quoted text clipped - 14 lines]
> (ImgPhoto1 and 2) to display a default image or to simply not display in the
> event of a photo not being present?
 
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



©2008 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.