Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2002
    Location
    Columbus, GA
    Posts
    81

    Unanswered: Display Image Based On Field

    Anyone know of a way to display an image based on the current record.

    Example, I have a form that shows current products that I sell. The form displays one product at a time and each profduct has 10 fields of data, I have all the images of the products (all the same size) stored on my network drive in lets say Z:\images\products

    Is there a way to say "Z:\images\products\"&[FiledName]&".jpg"

    The image will be named lets say product 1234

    Image would be named Z:\images\products\1234.jpg

    I would like when I go to the next record for the image to change to that product picture. I want the form to know that when it sees 1234 in the field name that it should show the image from the z:\ drive.

    Any ideas?

  2. #2
    Join Date
    Feb 2002
    Posts
    403
    I assume you have added an image to your form.

    Make the properties for this Linked, Picture should be (none), Stretch, etc.

    Call the image imgProd for product image.

    In the form OnCurrent event add the following code

    Me.imgProd.Picture="Z:\images\products\"&Me.FieldN ame&".jpg"

    Where field name is the name of the field that refers to the product name.

  3. #3
    Join Date
    Dec 2002
    Location
    Columbus, GA
    Posts
    81
    Worked Great, thanks for the help.

Posting Permissions

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