eed
09-10-2004, 08:26 AM
Hi, all,
I've got this generic function that I'm calling on the MouseDown events of a whole bunch of buttons:
Public Function OpenHelp(strTopic As String)
Dim frm As Form, strCriteria As String
strCriteria = "[CaseKey] = '" & strTopic & "'"
DoCmd.OpenForm "FmGlobalHelpWindow", , , strCriteria
End Function
Then each button has code like this:
Private Sub Command44_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = acRightButton Then OpenHelp ("AdminEVbtnA1")
End Sub
But it is taking a lot of code to capture the right-click in one place and then pass the string to the opening procedure. If the first, generic function could interpret the mouse button that was pressed, I think it would simplify things. So, instead of using an Event Procedure, the button's OnMouse property could be something like:
=OpenHelp(<<Button?>>, "AdminEVbtnA1")
And the OpenHelp function could be something like:
Public Function OpenHelp(btn as integer, strTopic As String)
Dim frm As Form, strCriteria As String
If btn = acRightButton Then
strCriteria = "[CaseKey] = '" & strTopic & "'"
DoCmd.OpenForm "FmGlobalHelpWindow", , , strCriteria
End If
End Function
What I am not sure of is how to pass the button's "click" value so that the OpenHelp function can then interpret its value as Left, Right, or Middle. Any ideas?
If I should give up on the right-click idea, is there another generic way to open a form filtered to the one record that corresponds to a specific control? I like the way some applications let you click on the toolbar to get a "?" cursor, which you can then click on to see the object's definition... But I'm unsure how to implement such a thing...
Thanks in advance for any and all thoughts.
I've got this generic function that I'm calling on the MouseDown events of a whole bunch of buttons:
Public Function OpenHelp(strTopic As String)
Dim frm As Form, strCriteria As String
strCriteria = "[CaseKey] = '" & strTopic & "'"
DoCmd.OpenForm "FmGlobalHelpWindow", , , strCriteria
End Function
Then each button has code like this:
Private Sub Command44_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = acRightButton Then OpenHelp ("AdminEVbtnA1")
End Sub
But it is taking a lot of code to capture the right-click in one place and then pass the string to the opening procedure. If the first, generic function could interpret the mouse button that was pressed, I think it would simplify things. So, instead of using an Event Procedure, the button's OnMouse property could be something like:
=OpenHelp(<<Button?>>, "AdminEVbtnA1")
And the OpenHelp function could be something like:
Public Function OpenHelp(btn as integer, strTopic As String)
Dim frm As Form, strCriteria As String
If btn = acRightButton Then
strCriteria = "[CaseKey] = '" & strTopic & "'"
DoCmd.OpenForm "FmGlobalHelpWindow", , , strCriteria
End If
End Function
What I am not sure of is how to pass the button's "click" value so that the OpenHelp function can then interpret its value as Left, Right, or Middle. Any ideas?
If I should give up on the right-click idea, is there another generic way to open a form filtered to the one record that corresponds to a specific control? I like the way some applications let you click on the toolbar to get a "?" cursor, which you can then click on to see the object's definition... But I'm unsure how to implement such a thing...
Thanks in advance for any and all thoughts.