Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2006
    Posts
    52

    Unanswered: how to relate to image in another form?

    Hellllo everyone...
    I am facing a problem related to images in forms.

    Well, here is my problem

    Form1: I have PicID field in a form based on table and an image box named img
    Form2: holds a number of image boxes..image1 hosts the picture of PicID if it is 1, image 2 hosts the picture of PicID if it is 2 and so on.

    Now I need somethings to do.
    1 ) in form1 coding I need to open form2 autumatically without me clicking on the form2...it sounds so simple and I really tried lots of codes but I don't know why it shouldn't work and I deleted all what I did due to frustration. so I can't post my code about this section

    2)Then I need to tell form1 to retrieve the image of the same value of PicID
    Here is my code put into a nextvaluebutton:
    Me.Img.Picture = Forms!Form2!Image & Me.PicID & .Picture 'of course Form2 should be open

    Me.Repaint


    This does not work...it works when I write this:
    Me.Img.Picture = Forms!Form2!Image1.Picture 'of course Form2 should be open
    but I want it to change the image box according to the change in value of PicID, so that it shows image1 if PicID = 1 and shows image2 if PicID = 2 and so on.
    I can't use IF statement since there are so much pictures

    Is it clear? I hope so....
    I know there are other ways to display pictures but i am really determined to do this because it suits the design of my program so well that I um fixed to it.


    Thanks a lot in advance.
    Last edited by oakeyes; 08-16-06 at 13:27.

  2. #2
    Join Date
    Feb 2004
    Posts
    137
    Try:
    Code:
    Me.Img.Picture = Forms("Form2").Controls("Image" & Me.PicID).Picture

  3. #3
    Join Date
    Aug 2006
    Posts
    52
    YES, this one works...I had not idea about this method.
    Thanks a lot for the help, I really highly appreciate it....

    finally open form worked with me this time, don't know what it didn't at first

    thaaaaaaaaaaaaaaaanks alot
    Last edited by oakeyes; 08-17-06 at 07:42.

Posting Permissions

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