My Access 2000 application has several command buttons in the main form, two of which are, say, cmdA and cmdB. Clicking each of these two commands will open a new different form. For both commands, the On Mouse Move property referred to a global function which essentially changes the colour of other command text.
On Mouse Move =gMouseMove(“frmInfo”,[cmdA])
On Mouse Move =gMouseMove(“frmInfo”,[cmdB])
The application runs well on all the machines under Win9x to WinXP, and MS Office 2000 all editions as well as MS Office XP (version 10.0.2627.1) Recently one of the users upgraded his Office XP to version Office XP SP1 (10.0.3409.0) under WinXP Home edition. This time when the user clicked on cmdA, it worked as expected. However when cmdB is clicked, the following error message appeared:
“The expression On Mouse Move you entered in the event setting produced the following error : Can’t find project or library.”
When I tried the application on my own Office XP SP1 (10.0.3409.0) under Win98, no such error occurred. Can someone tell enlighten me why?
A second question, how do we make the “Type a question for help” dropdown list on the upper right hand corner disappear in Office XP?
——————————————————————————————-
Function gMouseMove(frm, CtlName As Control)
Dim cntl As Control, fm As Form
Set fm = Forms(frm)
On Error Resume Next
‘If the command button is not already highlighted (in blue),
‘ the current fore color is saved in the tag property of the
‘ button and the colour is set to blue
If CtlName.ControlType = acCommandButton And CtlName.Tag = “” Then
CtlName.Tag = CtlName.ForeColor ‘Save original forecolor
CtlName.ForeColor = vbMagenta
End If
‘ Then any other command buttons on the form are checked and
‘ if they are highlighted they are switched off.
For Each cntl In fm.Controls
If cntl.ControlType = acCommandButton And _
cntl.Name CtlName.Name And cntl.Tag “” Then
cntl.ForeColor = cntl.Tag
cntl.Tag = “”
End If
Next
On Error GoTo 0
Set fm = Nothing
End Function