Results 1 to 8 of 8
  1. #1
    2 Star Lounger
    Join Date
    Feb 2003
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Ole Object (2002/sp2)

    I have a CD of bitmap Photos labeled with student ID numbers. I would like to load the pictures into a table so that I can connect the picture to the student record. I have been able to successfully load an individual picture into the table. There has to be a way I can load all two hundred pictures into the table at once.

    Any suggestions.

    Thanks.

    Paul

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Ole Object (2002/sp2)

    For a start i would not imbed these in a database, they will cause the database to bloat significantly.
    To link these i would use a DAO recordset to do it.

    I don't know how you would programmatically imbed them if you really want to go that way.

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Ole Object (2002/sp2)

    As patt wrote, you shouldn't store pictures in a table. Instead, load each picture as it is needed. Let's say that your pictures are named something like 12345.jpg where 12345 is the StudentID.
    In the table, you only need the StudentID.
    On a form bound to the table, add an unbound Image control, lets say imgPicture.
    Populate it with any picture, then clear the Picture property.
    Update the control in the On Current event of the form:

    Private Sub Form_Current()
    On Error GoTo ErrHandler
    Me.imgPicture.Picture = "E:Pictures" & Me.StudentID & ".jpg"
    Exit Sub
    ErrHandler:
    Me.imgPicture.Picture = ""
    End Sub

  4. #4
    2 Star Lounger
    Join Date
    Feb 2003
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Ole Object (2002/sp2)

    A couple questions Hans -

    Not sure what you meant by

    Populate it with any picture, then clear the Picture property.

    I put a picture in the box but not sure what to do to clear the picture property.

    In your code Me.imgPicture.Picture .... The last word picture does not pop up as an option when I add the . Should I still type in Picture.

    Also - To make this database work on someone else's computer, I was going to put both the pictues and the database in a folder "MathScience2007" That way I can just give him the folder with all the parts. What should I use as the path in the pictures in the code.

    The pictues are .BMP so I also changed that part of the code

    Thanks.

    Paul

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Ole Object (2002/sp2)

    I suspect that you used an unbound OLE control instead of an Image control.

    When you place an image control on a form, you'll be prompted to select a file. You can pick any image file, click OK, then clear the Picture property and confirm.

    IntelliSense should show Picture in the list of properties if you type a periiod . after the name of the control in the Visual Basic Editor.

    The code would become

    Me.imgPicture.Picture = CurrentProject.Path & "" & Me.StudentID & ".bmp"

  6. #6
    2 Star Lounger
    Join Date
    Feb 2003
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Ole Object (2002/sp2)

    The picture linking now works.

    Only problem is that the pictures now are not clear. Wavy colored lines throughout. Some setting must be off. Any ideas?

    Thanks again.

    Paul

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Ole Object (2002/sp2)

    I don't have an explanation for the poor image quality. I don't have this problem myself, either at work or at home, but I've seen frequent complaints about it in the Access newsgroups, so I know the problem is real. You might experiment with the Size Mode property of the image control - if the image is stretched or zoomed, it will look worse than if it is merely clipped.

  8. #8
    2 Star Lounger
    Join Date
    Feb 2003
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Ole Object (2002/sp2)

    Switching the size mode to zoom or stretch causes the poor quality. Clip setting is good but then the picture is so big it won't fit in the box I want to use.

    Strange thing is that when I was trying to use the unbound Object Frame box earlier the zoom command worked ok. It is an Image box issue.

    I'll have to think about what to do now.

    Paul

Posting Permissions

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