Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2003
    Location
    UK
    Posts
    85

    Question Unanswered: Problem with displaying images on form

    Dear All

    I am using the following objects on the form to display images;

    One text box that holds image paths (txtimagepath)
    An unbound object frame (myimagebox1)

    Following is the code being used:

    Private Sub Form_Current()
    On Error Resume Next
    If Not IsNull(Me![txtimagepath]) Then
    Me![myimagebox1].OLETypeAllowed = 1
    Me![myimagebox1].SourceDoc = Me![txtimagepath]
    Me![myimagebox1].Action = 0
    End If
    End Sub


    Private Sub txtimagepath_AfterUpdate()
    On Error Resume Next
    Me![myimagebox1].OLETypeAllowed = 1
    Me![myimagebox1].SourceDoc = Me![txtimagepath]
    Me![myimagebox1].Action = 0
    End Sub

    Now it works fine when image path is available. But when there is no image path in text box, the unbound object frame still displays the last image. When navigating the records it will keep on showing that one image for all next records till there is another image path available.

    How can this be solved so that it only shows the image for that record where the image path is mentioned.

    Thanks

  2. #2
    Join Date
    Nov 2003
    Posts
    1,487
    Try:

    Me![myimagebox1].SourceDoc = ""

    OR

    If IsNull(Me![txtimagepath]) then
    Me![myimagebox1].Visible = False


  3. #3
    Join Date
    Mar 2003
    Location
    UK
    Posts
    85
    Thanks for your reply. I have tried them and still it doesn't work.

    Any thing else you can think of?

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •