Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2009
    Posts
    10

    Unanswered: If statement for image

    hey

    On one of my forms (Products In) has a text box on it the shows what unit a product is in, either 9 or 10, and basically when the unit shows 9 i want an image to show of unit 9 layout, if its 10 then i want an image to show a picture of the layout of unit 10.

    Can anyone assist me in doing this please

    Im using access 2007

    Thanks

  2. #2
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    You could make 2 image files and then control whether they are visible or not using the:
    me.MyImageControl.visible = true

    Or you could also change the source for the image file itself within the control.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  3. #3
    Join Date
    Nov 2009
    Posts
    10
    would you be able to post the whole code needed to do this please using image1 and image 2 for the different images, its just im not the good with code atm

    Thanks

  4. #4
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    if me!MyFieldName = 9 then
    me.My9Image.visible = true
    me.My10Image.visible = false
    else
    me.My9Image.visible = false
    me.My10Image.visible = true
    end if

    or
    Select case me!MyFieldName
    Case 9
    me.My9Image.visible = true
    me.My10Image.visible = false
    case 10
    me.My9Image.visible = false
    me.My10Image.visible = true
    end select
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

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