Results 1 to 3 of 3
  1. #1
    rwahdan1978 is offline Advanced Beginner
    Windows 11 Access 2016
    Join Date
    Jun 2024
    Posts
    57

    Showing larger image in form2 from form1


    I have a form that is taking data from a query. One of the fields have a tring that holds the location (path) of image. some records have image and some don't. I can see the correct image in form1 but when clicking on it, it is going to form2 to show a large size of the same image sometimes it is right and sometimes it is the wrong image?

    form1 code:
    Code:
    Private Sub Image64_Click()
        DoCmd.OpenForm "form2"
    End Sub
    form2 code:
    Code:
    Private Sub Form_Load()
        Me.Image0.Picture = Forms!Form1!Image64.Picture
    End Sub

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,941
    I presume your first form is a continuous form. Image controls cannot receive the focus to set the selected record to current so your second form will be picking up whatever happens to be current.

    solution - overlay your image control in the first form with a transparent text box or button and apply your code to that control instead

  3. #3
    Join Date
    Jun 2022
    Posts
    28
    Here is a pair of articles about using a Conc() (concatenate) and Parse() function (source code included in the articles) to pass information to a form/report using the OpenArgs argument of the DoCmd.OpenForm/Report function. You could use this method to pass the path/name of the image file from form1 to form2, then parse it out and display it.

    https://nolongerset.com/part-and-parse-l/
    https://nolongerset.com/come-together/

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

Similar Threads

  1. Replies: 4
    Last Post: 01-25-2019, 05:08 AM
  2. Replies: 1
    Last Post: 10-03-2017, 02:16 AM
  3. Replies: 13
    Last Post: 05-14-2013, 06:01 PM
  4. Replies: 3
    Last Post: 09-19-2012, 11:40 AM
  5. Replies: 1
    Last Post: 12-01-2009, 09:00 AM

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