Is it possible to define a function as the result of an event procedure of a command button or form?
My problem: I have 18 different command buttons which I would like to define the following function:
Function ReturnWard()
Dim MyVar As String
MyVar = "11"
ReturnWard = MyVar
End Function
For each different button, I need the function to have a different value in the "MyVar" line. These different values will be called in a query criterion box which calls the "ReturnWard() function.
I want to use one query to get 18 different record sets into a form based on the cmd button clicked. So the function value has to change for each of the 18 buttons.
Is this possible?
My problem: I have 18 different command buttons which I would like to define the following function:
Function ReturnWard()
Dim MyVar As String
MyVar = "11"
ReturnWard = MyVar
End Function
For each different button, I need the function to have a different value in the "MyVar" line. These different values will be called in a query criterion box which calls the "ReturnWard() function.
I want to use one query to get 18 different record sets into a form based on the cmd button clicked. So the function value has to change for each of the 18 buttons.
Is this possible?