• Ole Object (2002/sp2)

    Author
    Topic
    #439472

    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

    Viewing 1 reply thread
    Author
    Replies
    • #1050278

      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.

    • #1050299

      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

      • #1050394

        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

        • #1050407

          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”

          • #1050413

            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

            • #1050417

              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.

            • #1050420

              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

    Viewing 1 reply thread
    Reply To: Ole Object (2002/sp2)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: