Results 1 to 8 of 8
  1. #1
    aamer is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Location
    Pakistan
    Posts
    276

    Post Combo Box drop down on mouse hover show & hide

    i am using the following code and it works fine





    Private Sub CboTSF_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

    Me.CboTSF.SetFocus
    Me.CboTSF.Dropdown

    End Sub


    The problem with this code is as I move mouse on the combo box it drops down (Which It should) butt i want to add a code so when I move the mouse pointer away from combo box, the drop down list of combo box is closed.

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    Try adding code to the mouse move event of the detail section of the form (or the section containing the combo).
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    aamer is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Location
    Pakistan
    Posts
    276
    can you guide what code

  4. #4
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    Set focus somewhere else.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    aamer is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Location
    Pakistan
    Posts
    276
    I tried the following but even this is not working


    Private Sub CboTSF_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

    Me.CboTSF.SetFocus
    Me.CboTSF.Dropdown
    Else
    Forms("AccTitleSearchFrm").SetFocus

    End Sub

  6. #6
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    Well, you don't have an If or an End If, but I think all you need is code in the detail section's mouse move event.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    aamer is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Location
    Pakistan
    Posts
    276
    can u help me writing the code i dont have much experience

  8. #8
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,127
    Remove the added Else and set focus lines from your code
    Then as already stated by pbaldy add a mouse move event to the detail section

    Code:
    Private Sub Detail_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
        
        Me.SomeOtherControlName.SetFocus
        
    End Sub
    Use a suitable control name from your form in the above code
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

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

Similar Threads

  1. Replies: 4
    Last Post: 02-19-2016, 10:17 AM
  2. Combo Box drop down on mouse hover
    By khughes46 in forum Forms
    Replies: 12
    Last Post: 07-02-2015, 11:17 AM
  3. Mouse Over/Hover Over
    By nndatabase in forum Forms
    Replies: 3
    Last Post: 06-07-2013, 04:45 PM
  4. Mouse Hover Feature in Access 2010???
    By taimysho0 in forum Programming
    Replies: 2
    Last Post: 07-19-2012, 03:19 AM
  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