PC Review


Reply
Thread Tools Rate Thread

Cancel Key Press Event

 
 
DZ
Guest
Posts: n/a
 
      3rd Feb 2008
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
 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      3rd Feb 2008
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
 
Reply With Quote
 
DZ
Guest
Posts: n/a
 
      3rd Feb 2008
Thank you

DZ
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Safe Mode: Press ESC to cancel loading SPTD.sys ju.c Windows XP Customization 8 25th Sep 2009 02:10 AM
connecting to printer press esc to cancel Rob Microsoft Word Document Management 2 16th May 2009 01:00 PM
Connecting to printer. Press ESC to cancel Brian Kitt Microsoft Word Document Management 2 28th Apr 2009 09:15 AM
Cancel button on [Enter] key press does not fire gnewsgroup Microsoft ASP .NET 0 27th Dec 2007 03:31 PM
CancelEventArgs.Cancel - How Event Raising Code Know if Client Set .Cancel=true Smithers Microsoft C# .NET 3 24th Sep 2007 02:30 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:43 AM.