Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2005
    Posts
    12

    Unanswered: Ye old image problem (this time with reports!)

    OK, so here's the deal. I inhereted this database from the previous intern, and now my employer wants me to change things all around and, well, i'm stumped. Basically, here's the situation...
    They want a photo based directory where there's a picture and under that is all the contact information. The contact info is in a table, and the location of a photo ("S:\\MembersDB\Photos\Name.jpg" for example) is stored in that table, as well. I was thinking that this would be really easy if I just used a report, but I can't seem to get those stupid little photos to show their heads. How do I talk my (well, the other intern isn't here, so it's mine now) database into showing those photos in a report so that it's all nice and pretty and my boss thinks I'm a genius?

  2. #2
    Join Date
    Aug 2004
    Posts
    178
    in the report put the path to the photo in a field called photo

    and in the on format of the section where you want to put the photo put this in

    Me.Image122.Picture = Me.Photo

  3. #3
    Join Date
    Oct 2005
    Posts
    12

    Thumbs up It works

    Thank you very much, and may infinate blessings be upon you and your progeney.

  4. #4
    Join Date
    Aug 2005
    Location
    New England
    Posts
    35

    Please, need more help.

    I have a table with resident information in it, as well as a text field that has the path to a photo of that resident. I have a form that works nicely at displaying the photo and giving options to add/change or delete if necessary. I am now trying to display the photo in a report, and can't seem to get it to work. I have the text field named Photo (which has the path to the photo itself) and an Image control with the Picture property empty. I've tried using Me.Image4.Picture=Me.Photo however it doesn't seem to like it at all. I get Run-Time error 13 Type Mismatch. I would be most greatful if someone could give me some ideas of what I might be doing wrong. Thanks. I'm using Access2003.
    Last edited by RAPUNIT; 03-20-06 at 18:17.

  5. #5
    Join Date
    Aug 2002
    Location
    Melbourne, Australia
    Posts
    111
    RAPUNIT,

    Have a look at the attached sample, Open the form frmAddPhotos, just add your photo description and path in the two controls ( I have left 1 of mine there for an example.)

    Before you use it you should set a default photo to view if there is an error with the path(s). Open the form frmPhotoDisplay in design view then look at the On Current code and you will see this;

    Code:
    NoPhoto:
        strPath = "C:\accessimages\NP.jpg" ' This is the photo that will be used if there is an error with the path
        Me.ImageFrame.Picture = strPath
    Change the Blue to suit the location of your "error" photo, I have used the question mark from clip art.

    I have also used the OpenArg so that when the report is closed with will open up the form on the same record that you were previewing.

    Let me know if it works for you.
    Attached Files Attached Files
    Last edited by ansentry; 03-21-06 at 04:48.
    Regards,



    John A

  6. #6
    Join Date
    Aug 2005
    Location
    New England
    Posts
    35

    Thanks for the help

    I ended up using your example to see that the issue was null fields in the Photo path. So I added an If...Then to the On Format code of the report using
    If IsNull(Photo) Then
    Me.Image122.Picture= "Default Path"
    Else
    Me.Image122.Picture=Me.Photo
    End If

Posting Permissions

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