Results 1 to 10 of 10
  1. #1
    khughes46 is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Grapevine, TX
    Posts
    231

    Combo Box Auto Expand

    Is there a way to get a combo Box to expand (drop down) when you tab into it or mouse over it?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,527
    An API call may do it. Tho, I cant find it.
    Are they too lazy to CLICK?

  3. #3
    khughes46 is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Grapevine, TX
    Posts
    231
    No, I have good users. I was just wondering if there was a way. I am not familiar with API, so I guess my answer is no. But thanks just the same.

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    A combo box has a dropdown property.

    Example from Access HELP
    Code:
    Private Sub SupplierID_GotFocus()
        Me!SupplierID.Dropdown
    End Sub

  5. #5
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    And to do it from mousing over it:
    Code:
    Private Sub SupplierID_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
     SupplierID.SetFocus
     SupplierID.Dropdown
    End Sub


    But there is a caveat, if used with a Continuous View or Datasheet View Form! On these types of Forms, If, for instance, Record #1 is the Current Record, and you mouse over the Combobox on Record #3, the Control that drops down is going to be the Combobox on Record #1...which could be confusing, depending on the specific Form design, especially with a Continuous Form.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  6. #6
    khughes46 is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Grapevine, TX
    Posts
    231
    WHat does the "Me!" indicate? I copied the code changing the DD Box name to be the name of my box and it isn't working.

  7. #7
    khughes46 is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Grapevine, TX
    Posts
    231
    My form is single. If I copy this code and change the DD Box name to mine will it work as is?

  8. #8
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    WHat does the "Me!" indicate?
    "Me" is an Access shortcut in code behind a form/report.
    Instead of using Forms!FormName.ControlName, in VBA you can use Me.ControlName or Me!ControlName.

    If I copy this code and change the DD Box name to mine will it work as is?
    Either code should work (mine or Linq's).

  9. #9
    khughes46 is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Grapevine, TX
    Posts
    231
    I got the code to work for MouseMove and GotFocus; just what I needed. Thanks again.

  10. #10
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Glad we could help!

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

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

Similar Threads

  1. Auto expand .. in a combo box
    By MyQuestion in forum Forms
    Replies: 1
    Last Post: 08-27-2013, 01:44 PM
  2. Replies: 3
    Last Post: 06-09-2013, 05:35 PM
  3. Replies: 3
    Last Post: 11-04-2011, 01:50 PM
  4. Auto expand memo field vertically to fit text
    By grant.smalley in forum Forms
    Replies: 1
    Last Post: 02-04-2010, 05:54 PM
  5. Auto-Populate Combo box
    By vincenoir in forum Forms
    Replies: 3
    Last Post: 10-14-2009, 07:06 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