All I can think of would be to pass the name of the control to your
procedure.
For instance:
Private Sub Rectangle1_Click()
Call YourControlFunction("Box44") 'for controls that can't get focus,
pass the name
End Sub
Private Sub TextBox1_Click()
Call YourControlFunction 'for controls that can get focus, no need to
pass its name
End Sub
If you have a lot of controls, you can save some work by selecting all the
controls that can get focus and putting '=YourControlFunction()' in the 'On
Click' event.
Private Function YourControlFunction(Optional byval strControlName As String
= "")
Dim ctL as Access.Control
If strControlName <> "" Then
Set ctL = Me(strControlName)
Else
Set ctL = Screen.ActiveControl
End If
If ctL.ControlType = acTextBox Then
Do something
ElseIf ctL.ControlType = acComboBox Then
Do something else
End If
End Function

Signature
AG
Email: discussATadhdataDOTcom
> Hi AG,
>
[quoted text clipped - 34 lines]
>> >
>> > John Dumay
John Dumay - 18 Jan 2008 04:51 GMT
Hi AG,
Looks like a perfectly good solution. Will give it a go and let you know.
Thanks for your assistance.
Regards,
John Dumay
> All I can think of would be to pass the name of the control to your
> procedure.
[quoted text clipped - 66 lines]
> >> >
> >> > John Dumay