QUOTE(jayman9 @ 18 Nov, 2007 - 05:39 PM)

You can call the button click event from inside the keypress event. Just pass it nothing for parameters. By calling the event, this will cause it to execute. Since a button didn't actually call the event there isn't any parameters to pass to the click event, so you just pass in a null value.
For example, if your button was named Button1, the call to the click event would look like this. Just replace "Button1_Click" with the name of your buttons click event.
CODE
Button1_Click(Nothing, Nothing)
Isn't this a VB Classic forum? The labels and menu choices are pretty clear.... but, if it's another dotNet forum, please let me know before I spend a lot of time answering questions here....
If it were VB Classic (ie pre-dotNet versions of VB), the best way to click a button using code would be to use syntax similar to....
Command1.Value = True 'Fires the button's click event.
Calling an event handler is, in my opinion, sloppy. If you need to run the same code from the button and elsewhere in your module, create a new procedure and call it from the button's click event.
Besides, directly calling any event handler makes it impossible (or nearly) to create libraries of reusable code.
Ken Halter
MS-MVP-VB