How do I make the subform the active control when the mouse moves over it?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mihail
    Contributor
    • Apr 2011
    • 759

    #16
    Replace the code in MY database with this one:

    Code:
    Private Sub Label_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
        If Not (ActiveControl.Name = "Subform") Then
            Beep
            Subform.SetFocus
            Txt = "The Subform HAS focus. Click the command button."
        End If
    End Sub
    then adapt for you.

    Comment

    • Seth Schrock
      Recognized Expert Specialist
      • Dec 2010
      • 2965

      #17
      I forgot that I needed to test out your code! Anyway, I just tried it on yours and it didn't flash. I adapted it for my database and it flashed. So I decided to do a test and commented out all of the code and it still flashed. Another thing that I noticed is that the VBA editor says that mine is constantly running whereas yours does not. So I think that it has something to do with my database. Thanks for your help.

      Comment

      • Mihail
        Contributor
        • Apr 2011
        • 759

        #18
        Hm.
        Try to copy-paste MY label from MY form into your form.
        Or import MY form in your database and work with it.

        I can't see any reason for your trouble.
        Sorry.

        Comment

        Working...