Hello 
Yesterday I moved from Access 2007 to 2013 because all other computers here at work is updating Office so now I have a small problem with a few of my forms.
In 2007 I used "form on mouse move event" so I didn't have to use an click event on all buttons on the form, this way I would just name the button "btnIDXXX" where XXX is the ID of the record and I could left click on the buttons to open them in a new form, just hovering over the buttons would do nothing.
My function code below.
Then on the "form on mouse move event" I would just have
And this worked perfect in 2007 but now that I am on 2013 for some reason it looks like the form on mouse move event don't register at all. the closest I am to a solution is moving the "Call MouseUI(me)" code to form on mouse wheel event but then I have to click the button to set focus then scroll with the mouse wheel to open the record in a new form...
I have tried to google this but couldn't find any change in form mouse events from Microsoft or anyone else with this exact problem so any help would be appreciated
Edit-------- <Static> fixed my problem and here is the code I used

Yesterday I moved from Access 2007 to 2013 because all other computers here at work is updating Office so now I have a small problem with a few of my forms.
In 2007 I used "form on mouse move event" so I didn't have to use an click event on all buttons on the form, this way I would just name the button "btnIDXXX" where XXX is the ID of the record and I could left click on the buttons to open them in a new form, just hovering over the buttons would do nothing.
My function code below.
Code:
Public Sub MouseUI(Frm As Form)
Dim btnID As String
If Left(Frm.ActiveControl.Name, 5) = "btnID" Then
btnID = Right(Frm.ActiveControl.Name, Len(Frm.ActiveControl.Name) - 5)
Frm.btn_List.SetFocus
DoCmd.OpenForm "InstrumentInfo", , , _
"[InstrumentList.ID]= " & btnID
Else
If Left(Frm.ActiveControl.Name, 8) = "btnClose" Then
DoCmd.Close acForm, Frm.Name
End If
End If
End Sub
Then on the "form on mouse move event" I would just have
Code:
Call MouseUI(me)
And this worked perfect in 2007 but now that I am on 2013 for some reason it looks like the form on mouse move event don't register at all. the closest I am to a solution is moving the "Call MouseUI(me)" code to form on mouse wheel event but then I have to click the button to set focus then scroll with the mouse wheel to open the record in a new form...
I have tried to google this but couldn't find any change in form mouse events from Microsoft or anyone else with this exact problem so any help would be appreciated

Edit-------- <Static> fixed my problem and here is the code I used

Code:
Public Sub TestUI_Load(frm As Form)
Dim Name As String
Dim ctl As Control
For Each ctl In frm.Controls
If Left(ctl.Name, 5) = "btnID" Then
ctl.OnClick = "=OnMouseClickEvent(""" & Mid(ctl.Name, 6) & """)"
End If
Next
End Sub
Public Function OnMouseClickEvent(btnID As String)
DoCmd.OpenForm "InstrumentInfo", , , "[InstrumentList.ID]= " & btnID
End Function
Code:
Private Sub Form_Open(Cancel As Integer)
Call TestUI_Load(Me)
End Sub
Last edited: