Images on forms

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Darren Allen

    Images on forms

    Here's some fresh meat for the newsgroup hyenas.

    I'm pretty new to setting up Access db's, so please be gentle.

    How do I get my user forms to display a linked image file for each record.
    (Eg. person's mugshot on a form with their personal details). This sounds
    simple, and I'm surprised that I haven't worked it out yet.

    I've tried the most obvious ways, but only seem to get the file icon not the
    image itself.

    Thanks, and sorry for wasting your valuable time.

    DA


  • Deano

    #2
    Re: Images on forms

    Darren Allen wrote:[color=blue]
    > Here's some fresh meat for the newsgroup hyenas.
    >
    > I'm pretty new to setting up Access db's, so please be gentle.
    >
    > How do I get my user forms to display a linked image file for each
    > record. (Eg. person's mugshot on a form with their personal details).
    > This sounds simple, and I'm surprised that I haven't worked it out
    > yet.
    >
    > I've tried the most obvious ways, but only seem to get the file icon
    > not the image itself.
    >
    > Thanks, and sorry for wasting your valuable time.
    >
    > DA[/color]

    Not done it myself but make sure you're working with bitmaps first and
    foremost. I don't think Access likes anything else.


    Comment

    • fredg

      #3
      Re: Images on forms

      On Sat, 21 Aug 2004 02:28:23 +1000, Darren Allen wrote:
      [color=blue]
      > Here's some fresh meat for the newsgroup hyenas.
      >
      > I'm pretty new to setting up Access db's, so please be gentle.
      >
      > How do I get my user forms to display a linked image file for each record.
      > (Eg. person's mugshot on a form with their personal details). This sounds
      > simple, and I'm surprised that I haven't worked it out yet.
      >
      > I've tried the most obvious ways, but only seem to get the file icon not the
      > image itself.
      >
      > Thanks, and sorry for wasting your valuable time.
      >
      > DA[/color]

      Add a field to your table, [Picname], that stores the name of the
      picture associated with the person, i.e. "JohnSmith. jpg"
      Store all the pictures in the same folder, but not as part of the
      database.

      Add an Image control to the form using any image to start with.
      Set it's PictureType property to Linked.
      After you save the control, delete it's Picture property.

      Then code the Form's Current Event:

      On Error Resume Next
      Me!ImageName.Pi cture = "c:\Folder Path\" & Me![PicName]

      You can use, among others, .bmp, and .jpg picture types.
      --
      Fred
      Please only reply to this newsgroup.
      I do not reply to personal email.

      Comment

      • Larry  Linson

        #4
        Re: Images on forms

        "Darren Allen" wrote
        [color=blue]
        > Here's some fresh meat for the
        > newsgroup hyenas.[/color]

        Eh? Would you care to clarify whether that was intended to be "cute" or
        insulting?
        [color=blue]
        > How do I get my user forms to display
        > a linked image file for each record.
        > (Eg. person's mugshot on a form with
        > their personal details). This sounds
        > simple, and I'm surprised that I haven't
        > worked it out yet.[/color]

        . . .
        [color=blue]
        > Thanks, and sorry for wasting your valuable time.[/color]

        If we thought answering questions in newsgroups was a waste, chances are
        high that we wouldn't do it. Most of us have been helped many, many times
        and the only repayment ever asked was that, when able, we help someone else.

        The sample imaging databases at http://accdevel.tripod.com illustrate three
        approaches to handling images in Access, and the download includes an
        article discussing considerations in choosing an approach. Two of the
        approaches do not use OLE Objects and, thus, avoid the database bloat, and
        some other problems, associated with images in OLE Objects.

        If you are printing the images in reports, to avoid memory leakage, you
        should also see MVP Stephen Lebans' http://www.lebans.com/printfailures.htm.
        PrintFailure.zi p is an Access97 MDB containing a report that fails during
        the Access formatting process prior to being spooled to the Printer Driver.
        This MDB also contains code showing how to convert the contents of the Image
        control to a Bitmap file prior to printing. This helps alleviate the "Out of
        Memory" error that can popup when printing image intensive reports.

        Larry Linson
        Microsoft Access MVP


        Comment

        Working...