PC Review


Reply
Thread Tools Rate Thread

Close form when I press enter

 
 
Michelle
Guest
Posts: n/a
 
      22nd Nov 2008
I have a user-form with a 2-column combo box, and the combo-box opens as
soon as the form is displayed using:

Private Sub UserForm_Activate()
ddCodes.SetFocus
SendKeys ("{F4}")
End Sub

When I select an entry (or type the first letter of an entry and press
Enter), it closes the list, and then I have to press Enter (again) to
trigger the After_Update event (which closes the form and puts the value
into the cells).

I want to only have to only have to select an entry (or type and press Enter
once) to trigger an event - I don't care which event it is - I want to make
it as easy as possible for the users to select items from the list.

However, I can't use the change event, because that is triggered each time a
single character is typed, and sometimes users have to type multiple
characters into the box. Is there a way around this?

Appreciate your help - thanks

Michelle

 
Reply With Quote
 
 
 
 
JP
Guest
Posts: n/a
 
      23rd Nov 2008
Have you tried the BeforeUpdate Event?

--JP


On Nov 22, 8:29 am, "Michelle" <mh_londonNOJ...@hotmail.com> wrote:
> I have a user-form with a 2-column combo box, and the combo-box opens as
> soon as the form is displayed using:
>
> Private Sub UserForm_Activate()
> ddCodes.SetFocus
> SendKeys ("{F4}")
> End Sub
>
> When I select an entry (or type the first letter of an entry and press
> Enter), it closes the list, and then I have to press Enter (again) to
> trigger the After_Update event (which closes the form and puts the value
> into the cells).
>
> I want to only have to only have to select an entry (or type and press Enter
> once) to trigger an event - I don't care which event it is - I want to make
> it as easy as possible for the users to select items from the list.
>
> However, I can't use the change event, because that is triggered each time a
> single character is typed, and sometimes users have to type multiple
> characters into the box. Is there a way around this?
>
> Appreciate your help - thanks
>
> Michelle


 
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
Stop form from closing when I press Enter RebeccaKT Microsoft Access Forms 3 8th Dec 2009 09:57 PM
Why is a sound played when I press alt-enter on a form? yesthatmcgurk@gmail.com Microsoft Dot NET Framework Forms 3 8th Jun 2007 10:28 PM
Why word close when I press enter? =?Utf-8?B?aGlsZGE=?= Microsoft Word Document Management 1 1st Apr 2006 09:17 AM
press enter in textfield, execute lines and close form A.J.M. van Rijthoven Microsoft Access 2 11th May 2005 11:40 AM
Avoid enter key press to submit form huan Microsoft Dot NET 0 18th Nov 2003 09:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:31 PM.