Results 1 to 2 of 2
  1. #1
    exo is offline Novice
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    28

    "runaway button"

    A break from the more serious threads. Using jscript on a website it is possible to make a user button "runaway" from the mouse cursor.



    Got a new guy coming in to learn one of the databases I've created and I'd like to have a little fun, so I was thinking about doing something similar with the command buttons on the form. Anyone have any ideas how to accomplish this?

    Thanks =)

  2. #2
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    VBA doesn't have a mouse-to-control tracker that I'm aware of. However, what you can do is use the MouseMove event to set the Visible attribute to false of one button while turning on another button with the same caption when the user hovers the mouse over the control.

    create 3 buttons on a form then:
    Code:
    Option Compare Database
    
    Private Sub Command0_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    
    Me.Command1.Visible = True
    Me.Command1.SetFocus
    Me.Command0.Visible = False
    Me.Command2.Visible = False
    
    End Sub
    Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    
    Me.Command2.Visible = True
    Me.Command2.SetFocus
    Me.Command0.Visible = False
    Me.Command1.Visible = False
    
    
    End Sub
    Private Sub Command2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    
    Me.Command0.Visible = True
    Me.Command0.SetFocus
    Me.Command1.Visible = False
    Me.Command2.Visible = False
    
    End Sub

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

Similar Threads

  1. Replies: 13
    Last Post: 07-27-2011, 12:38 PM
  2. Replies: 16
    Last Post: 07-22-2011, 09:23 AM
  3. Replies: 6
    Last Post: 03-10-2011, 11:31 AM
  4. Replies: 3
    Last Post: 08-10-2010, 02:12 PM
  5. Replies: 3
    Last Post: 02-23-2010, 06:32 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