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

    Combo Box drop down on mouse hover


    Is there a way to get a combo box to drop down when hovering the mouse over the box? I'm in Access 2010. Thanks.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    I don't think so. Can make it dropdown when the box gets focus.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I have never tried it before but there is this ...
    https://msdn.microsoft.com/en-us/lib.../ff835703.aspx

    I think it would just irritate the user. It seems even less useful than the MouseUp and MouseDown events.

  4. #4
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933
    It seems even less useful than the MouseUp and MouseDown events.
    you haven't lived

    the dropdown occurs when you click on the down arrow (so has focus) - but so far as I am aware there is no event you can associate with it

    you can mimic the effect you require by having a textbox, a button and a listbox set up to look like a combobox. the button click event (which would make the listbox appear) could be called from the textbox mousemove event

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    @khughes46

    Can you describe why you want the drop down to occur with mouse hover? Perhaps there are options to hover and drop down.

  6. #6
    khughes46 is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Grapevine, TX
    Posts
    231
    So the user can see the items available for selection without clicking in the dropdown arrow. The dropdown will show even if you roll over the label.

  7. #7
    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
    Code:
    Private Sub ComboName_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
     ComboName.SetFocus
     ComboName.Dropdown
    End Sub

    Note that if the Combobox is in the Detail Section, on Continuous or Datasheet View Forms, the Combobox of the Record that is currently selected is the one that will dropdown.

    Linq ;0)>

  8. #8
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by Missinglinq View Post
    ComboName_MouseMove
    Interesting, this is something I have ignored and was unaware of.

  9. #9
    khughes46 is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Grapevine, TX
    Posts
    231
    I'm sure this is what I was Looking for. Thanks.

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Just tested. As I expected, the control must have focus first. So this does eliminate a click but requires mouse movement. I build forms so user can move through without mouse. So think still need dropdown method code in GotFocus event.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  11. #11
    khughes46 is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Grapevine, TX
    Posts
    231
    I got this code from Misslinq above and it works just like I need it to. It's very simple, highlight the combo box, go to Event, click in MouseMove, use the code builder (it starts you out with what you need) the add ComboName.SetFocus ComboName.DropDown and it's done. Finished it looks like:

    Private Sub ComboName_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    ComboName.SetFocus
    ComboName.Dropdown
    End Sub

  12. #12
    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
    Quote Originally Posted by June7 View Post

    As I expected, the control must have focus first. So this does eliminate a click but requires mouse movement.
    The control doesn't need Focus...that's what the first line of code provides. And, yes, mouse movement is required...you can't do it by telepathy! Eliminating the click needed to cause the dropdown was the object...not eliminating moving the mouse/cursor.

    Glad it's working for you, khughes46!

    Linq ;0)>

  13. #13
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Note my following statement: I build forms so user can move through without mouse.

    The control must get focus, programmatically or by click or tab into, otherwise the DropDown method will not work. My point is, if user tabs into the combobox, the dropdown will not activate, hence my suggestion to also use the GotFocus event.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 2
    Last Post: 08-27-2014, 08:19 AM
  2. Mouse Over/Hover Over
    By nndatabase in forum Forms
    Replies: 3
    Last Post: 06-07-2013, 04:45 PM
  3. Mouse Hover Feature in Access 2010???
    By taimysho0 in forum Programming
    Replies: 2
    Last Post: 07-19-2012, 03:19 AM
  4. Formating a Drop Down Combo Box
    By Douglas Post in forum Forms
    Replies: 3
    Last Post: 02-01-2012, 03:18 PM
  5. Creating a mouse hover event
    By Coffee in forum Forms
    Replies: 1
    Last Post: 07-17-2011, 11:25 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