Results 1 to 7 of 7
  1. #1
    tylerg11 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Sep 2011
    Posts
    200

    Selecting a combobox item with VBA


    I am trying to use VBA to select a combobox value. My code can place the value in the combobox, but then I have to open the list and select the value manually in order for it to really be selected. Just wondering if there is some sort of property that actually selects the item, instead of just placing the value in that combobox control.

  2. #2
    TG_W is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2010
    Location
    Manvel, TX
    Posts
    299
    If you're using VBA to populate, why not make the Combo Box a Text Box? If you still want to give users the option of the box, maybe you can have it be a different filtration code.

  3. #3
    tylerg11 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Sep 2011
    Posts
    200
    This won't work in my situation.

  4. #4
    TG_W is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2010
    Location
    Manvel, TX
    Posts
    299
    Well, without much more detail, I'm afraid I can't be of much more help. Sorry.

  5. #5
    TG_W is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2010
    Location
    Manvel, TX
    Posts
    299
    I'll take one more stab at it for now - what about adding Me.Requery after updating the value?

  6. #6
    tylerg11 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Sep 2011
    Posts
    200
    Neither Me.Requery or Me.Refresh work.

    I figured out that ComboBox.ListIndex will do that trick. However, now I need to find out how to find the ListIndex if my value matches with the one I want to select in the dropdown.

  7. #7
    TG_W is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2010
    Location
    Manvel, TX
    Posts
    299
    Ok, again, without knowing much more information, I don't think I can help much further. Sorry.

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

Similar Threads

  1. Replies: 2
    Last Post: 04-10-2012, 12:30 AM
  2. Replies: 2
    Last Post: 03-02-2012, 01:28 PM
  3. Replies: 7
    Last Post: 10-25-2011, 08:32 PM
  4. Replies: 2
    Last Post: 12-21-2010, 12:03 AM
  5. Selecting text - ComboBox
    By Numbat in forum Programming
    Replies: 2
    Last Post: 06-05-2006, 05:42 PM

Tags for this Thread

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