By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,984 Members | 1,045 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,984 IT Pros & Developers. It's quick & easy.

Photos in Reports

P: n/a
I have an Access 2003 database that has a text field which contains a
path to a photo. Each new page of the report links to and displays the
photo.

I use the following code:

Private Sub Report_Page()
Dim sPath As String
On Error GoTo ERR

sPath = PathOnly(Forms!frmMain!txtPath.Value) & "Photos\" & Nz
(txtPhoto.Value, "Empty")
If FileExists(sPath) Then
Debug.Print sPath
imgSitePhoto.Visible = True
lblNoPhoto.Visible = False
imgSitePhoto.Picture = sPath
Else
imgSitePhoto.Visible = False
lblNoPhoto.Visible = True
End If
ERR:
End Sub

This works for the most part, but I get weird happenings every once in
a while. Sometimes new photos don't load on every new page.

Any ideas? Or a better way to handle this?

Chris
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Actually I think I got it figured. I moved my code to the
Format_Detail() event and it seems to be ok now.

Chris
ch*******@houston.rr.com (Chris Hartnell) wrote in message news:<33**************************@posting.google. com>...
I have an Access 2003 database that has a text field which contains a
path to a photo. Each new page of the report links to and displays the
photo.

I use the following code:

Private Sub Report_Page()
Dim sPath As String
On Error GoTo ERR

sPath = PathOnly(Forms!frmMain!txtPath.Value) & "Photos\" & Nz
(txtPhoto.Value, "Empty")
If FileExists(sPath) Then
Debug.Print sPath
imgSitePhoto.Visible = True
lblNoPhoto.Visible = False
imgSitePhoto.Picture = sPath
Else
imgSitePhoto.Visible = False
lblNoPhoto.Visible = True
End If
ERR:
End Sub

This works for the most part, but I get weird happenings every once in
a while. Sometimes new photos don't load on every new page.

Any ideas? Or a better way to handle this?

Chris

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.