Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
DZ DZ is offline
external usenet poster
 
Posts: 29
Default Cancel Key Press Event

How can I cancel the Key Press Event in a Excel 97 Combo Box from Controls
Toolbar.

The Event Procedure is

Private Sub cboField_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)

End Sub

What I want to do is prevent the user from entering any text into the combo
box, because the combo box is for making selections only, not entering new
values.

In Access, I would use the Docmd.Cancel Event, but there should be a way to
accomplish the same thing in Excel

Thank you
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Cancel Key Press Event

I think it would make more sense (as a user) to change the .style property to
fmStyleDropDownList (it won't allow new entries) and change the .matchrequired
property to true (and maybe change the .matchentry to fmMatchEntryComplete (to
help choose from the list)).

But you could use
KeyAscii= 0
(but that doesn't seem very user friendly to me.)


DZ wrote:

How can I cancel the Key Press Event in a Excel 97 Combo Box from Controls
Toolbar.

The Event Procedure is

Private Sub cboField_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)

End Sub

What I want to do is prevent the user from entering any text into the combo
box, because the combo box is for making selections only, not entering new
values.

In Access, I would use the Docmd.Cancel Event, but there should be a way to
accomplish the same thing in Excel

Thank you


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
DZ DZ is offline
external usenet poster
 
Posts: 29
Default Cancel Key Press Event

Thank you

DZ
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how can I trap the change event (Tab Press key) of these controls Padam Excel Programming 2 August 11th 06 09:41 AM
how can I trap the change event (Tab Press key) of these controls Padam Excel Programming 2 August 11th 06 09:40 AM
how can I trap the change event (Tab Press key) of these controls Padam Excel Worksheet Functions 1 August 10th 06 03:59 PM
Key Press Event Todd Huttenstine Excel Programming 0 March 3rd 06 05:02 PM
key press event? short_n_curly[_19_] Excel Programming 2 July 15th 05 08:43 PM


All times are GMT +1. The time now is 04:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"