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 / April 2008

Tip: Looking for answers? Try searching our database.

Linked image not displayed on form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
shelter@jointanimalservices.org - 16 Apr 2008 01:07 GMT
I am running Access 2003.

Thanks to one of John Viescas' books, I've been able to add and
display an image on a form. Unfortunately, as soon as I move to a new
record in the form, then go back to the first record, the first
record's image is no longer displayed.

Thank you for any help.

DJohnson

Here is my code to display the image:

Private Sub Form_Current()
Dim strPath As String

   If Me.NewRecord Then
       Me.lblMsg.Caption = "Click Add to insert a photo of this
volunteer."
       Me.lblMsg.Visible = True
       Me.imgVolunteer.Visible = False
       Exit Sub
   End If

   On Error Resume Next
   If IsNull(Me.Photo) Then
       Me.lblMsg.Caption = "Click Add to insert a photo of this
volunteer."
       Me.lblMsg.Visible = True
       Me.imgVolunteer.Visible = False
   Else
       strPath = Me.txtPhoto
       If (InStr(strPath, ":") = 0) And (InStr(strPath, "\\") = 0)
Then
           strPath = CurrentProject.Path & "\" & strPath
       End If
       Me.imgVolunteer.Picture = strPath
       If Err <> 0 Then
           Me.lblMsg.Caption = "Photo not found. Click Add to
correct."
           Me.lblMsg.Visible = True
           Me.imgVolunteer.Visible = False
       Else
           Me.imgVolunteer.Visible = True
           Me.PaintPalette = Me.imgVolunteer.ObjectPalette
       End If
   End If
End Sub
Carl Rapson - 16 Apr 2008 21:34 GMT
>I am running Access 2003.
>
[quoted text clipped - 44 lines]
>    End If
> End Sub

Try putting a breakpoint on the first executable statement in Form_Current
and step through the code to see just what's happening and where any error
might be occurring.

Carl Rapson
shelter@jointanimalservices.org - 18 Apr 2008 18:54 GMT
On Apr 16, 1:34 pm, "Carl Rapson" <mr.mxyzp...@newsgroups.nospam>
wrote:
> <shel...@jointanimalservices.org> wrote in message
>
[quoted text clipped - 56 lines]
>
> - Show quoted text -

Thank you for your response.
 
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.