Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Enter Key / Text Box

Status
Not open for further replies.

mavest

Programmer
Feb 27, 2003
54
US
Taking a risk being stupid, I'll ask the following.

In Visio, I have a very small user form, only contains a textbox.

After the user enters a number they want to press the ENTER key to do some stuff with the number, i.e. run some VBA code that reads textbox.text and processes the number.

I've noticed that the KeyPressed event does not fire for the ENTER key! and can't seem to find any event that fires for the ENTER key. I must be missing something obvious, but have search many Visio forms, and the MSDN, as well as my VBA help files.

Please take pity on my stupidity - thanks!
 
I'd suggest adding a commandbutton to carry out your wishes.

The properties can be set so that ENTER will fire it off.

Dave

"Probably the only Test Analyst on Tek-Tips"

Take a look at Forum1393 & sign up if you'd like
 
Sound great!

I hadn't thought about a hidden command button.

How do I set its properties such that ENTER is same as pressing the button.
 
Hi mavest,

I'm not sure with Visio but if you only have one button it is, by default, the default, so to speak. In other words you probably won't have to do anything - pressing Enter probably does act like the button was pressed.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top