yes i was wondering what the code is so that when ya hit enter it enter's the command button like ya clicked it
Printable View
yes i was wondering what the code is so that when ya hit enter it enter's the command button like ya clicked it
Just set the commands button Default property to true. That will make it so everytime you hit enter, that command button will be activated.
You can also change it during runtime with
Command1.Default = True ' Or False
Hope that helps :)
It depends on what you want the code to do and what you are hitting enter on.... Your question is a bit unclear.
Usually you enter your code in the sub procedure of a particular event. For instance in the click event of a command button, you would type your code in the Private Sub Command1_Click() section.
Try a message box:
VB Code:
Private Sub Command1_Click() MsgBox "Hello World!" End Sub
Forgive me if this is not the question you were asking. Please try and give us a little more information as to what it is you are trying to accomplish.
There are also alot of tutorials and code snippets available on this site that can be extremely helpful.
I usually try and do searches of previous posts before I post my own question (90% of the time I find my answer w/o having to post) and try to give whatever code I have already written included in my post, otherwise I may not get any responses...
Hope that helps :)
ahhh helps verry mutch ty
doh..... :blush:Quote:
Just set the commands button Default property to true. That will make it so everytime you hit enter, that command button will be activated.
You can also change it during runtime with
Command1.Default = True ' Or False