Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

How can I detect a tab or carriage return in combo box

Status
Not open for further replies.

jrice174

Civil/Environmental
Nov 8, 2004
129
On a VBA user form I have some list boxes and combo boxes. As the user enters data and then hits a tab or carriage return to go to the next box I would like to sense the tab or carriage return so I can use that data immediately. Is there an event that I can use or a way to sense the carriage return?
 
Replies continue below

Recommended for you

Perhaps use KeyUp/KeyDown/Keypress and check the ASCII code of the key. Works for textboxes.
 
You can recognize the Enter key with the KeyPress event of the ListBox / Combobox. The Tab key will not be recognized, but it will fire the ListBox_Exit event, for example.

Cheers,
Joerd

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
 
Thanks that did it. I really appreciate how quickly I get great answers from this forum.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor