Personally I try to avoid having more than one piece of code doing the same
thing so I would call the existing code. If you don't it tends to trip you up
later when you change one call but forget about the other one!
Just call it by name, something like:
ControlName_Click
John
##################################
Don't Print - Save trees
croy wrote:
> On Tue, 06 Nov 2007 13:00:01 +0000, John Smith
> <johnDOTsmithATbromleyhospitalsDOTnhsDOTuk> wrote:
>
>> Use the KeyPress event of the control:
>>
>> Private Sub SomeControl_KeyPress(KeyAscii As Integer)
>> If KeyAscii = 43 Then
>> DoCmd.OpenForm "Some Form"
>> KeyAscii = 0 ' Stop the + from going to the control
>> End If
>> End Sub
>>
>> Plus whatever other code you need.
>
>
> Thanks John. That's a huge help, especially the comments in
> the code.
>
> If there is already form-opening code for the OnClick event
> for this control, is it better to call the OnClick event, or
> use separate code, like above (assuming that it's even
> possible to call another event's code)?
|