Results 1 to 4 of 4
  1. #1
    steve7800 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    41

    Add image control "on the fly"

    I have a form which displays data one record at a time. Some records have a file path to an image, some records have paths to more than one image. Many records have no related image.



    In the Load event I can determine if the record has related image or images. If it does, I would like to add an image control for each related image and set the image control source to the file path for the image.

    How can I add image controls “on the fly” as the need for them is determined? How do I set the source of the added image controls to the file path?

    Thanks.

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,798
    You can only add controls while in design view. You probably need a subform (continuous or datasheet) that will, when a record is selected, show the image for that record in the image control on the main form. What you're describing just doesn't seem practical.
    Last edited by Micron; 01-21-2019 at 11:19 PM. Reason: spelin and gramur
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    Gicu's Avatar
    Gicu is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    Have you considered using a continuous subform with three controls bound to a table having your RecordID as the foreign key of your main records table(hidden), another text box for the path and a third image control where you load the pic. It makes things a lot easier...

    Cheers,
    Vlad

  4. #4
    steve7800 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    41
    Thanks guys. I'll look into the subform idea. Might be back with questions about subforms

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 13
    Last Post: 01-24-2018, 02:51 PM
  2. Replies: 12
    Last Post: 12-21-2016, 04:27 AM
  3. Replies: 1
    Last Post: 09-07-2015, 08:00 AM
  4. Replies: 7
    Last Post: 11-08-2013, 08:28 PM
  5. Replies: 6
    Last Post: 10-17-2013, 03:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums