Results 1 to 7 of 7
  1. #1
    vdanelia is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jan 2011
    Posts
    38

    Combo box Value Must Show an object: How To

    Hello Dear friends, I have a question and Need your Help!



    I have a form and Combo Box (Hardware) on it, with values: Swithc, Main board, Server, Desktop, etc. (Connected with main table)
    For example When i choose from drop down list a Desktop or Server i want that near the combo box appear an image (something like icon which I'll set ) and when i click the image it will open additional form (Desktop Details) where i can enter or read the additional information about the desktop. I already have that form named details connected with the main table.

    I just want only the function which will show that hidden image after i choose a desktop value from the combo box listing

    Thank you very much

  2. #2
    jgelpi16 is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Mar 2010
    Location
    Charlotte, NC
    Posts
    544
    There is probably a better method than this if your list is fairly dynamic and large. One method is as follows...

    Create a column in your combo box source table that has a control name/unique identifier for each image (maybe just the image object's name). In the click even of the combo box you can then run a series of IF statements to check if the image name = the field's name in your control column. IF it matches then set the image to visible = true.

    Like I said this method could get sluggish if you have a large list or have a fairly dynamic list. There may be a better method of calling the image name with a variable but I'm not aware of it.

  3. #3
    vdanelia is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jan 2011
    Posts
    38
    Jgelpi16 for your reply, I'll try that... and 'll post the results

  4. #4
    vdanelia is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jan 2011
    Posts
    38
    Maybe I not described my problem well
    Please Look at my test database
    http://dl.dropbox.com/u/6200480/TEST.accdb
    I put near the combo box a image (I set the Image property to hide)
    When i Select from combo box Value Server this image must be visible, I couldn't manage the VBA code for it, maybe it looks like:

    Select Case Me.Hardware
    Case "Server"
    and if case "Server" is chosen then the image (named ok.png near the combo box, which is hidden must be visible)
    Case Else
    DoCmd.OpenForm "ERROR", acNormal
    End Select

    Please Help!

  5. #5
    jgelpi16 is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Mar 2010
    Location
    Charlotte, NC
    Posts
    544
    Ok. I was making this way too complicated. Take a look at the attached DB.

  6. #6
    vdanelia is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jan 2011
    Posts
    38
    Waw! Cooollllllll
    Thank you Jgelpi16... This is what i needed... Yesss
    You're Super!

  7. #7
    vdanelia is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jan 2011
    Posts
    38
    Hello Jgelpi16, I have a question.... Your code works perfectly, but i want do add One Value too..
    If vModelValue = "SERVER" Or vModelValue = "DESKTOP" (I added this, It works, But I wanted to know is it normal or is another best way) Thank you
    Last edited by vdanelia; 02-03-2011 at 07:22 AM.

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

Similar Threads

  1. Bound Object Frame Combo sorted Results
    By kevsim in forum Programming
    Replies: 7
    Last Post: 01-08-2011, 06:30 PM
  2. Replies: 3
    Last Post: 11-02-2010, 10:14 AM
  3. Replies: 4
    Last Post: 10-18-2010, 09:44 PM
  4. Replies: 1
    Last Post: 08-05-2010, 12:11 PM
  5. cant find the object
    By AccessLes in forum Forms
    Replies: 1
    Last Post: 06-30-2010, 12:41 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