Enter Key Behavior in Combo Box

I have a series of combo boxes that the user will populate at runtime.
I have trapped the "Enter" key to trigger the population code.
However, the "Enter" key also moves the insertion point to the next
combobox. I know I can alter Enter Key behavior for the whole
database, but I would like be able to do it for the controls on one
form which contains both  text boxes and combo boxes. I still want to
be able to use Tab to move through the controls but want to disable
the tabbing effect of the Enter Key

How can I do this?

Thanks

Dave Wetmore
0
dwetmore
1/10/2008 4:48:09 PM
access.formscoding 7493 articles. 0 followers. Follow

2 Replies
1689 Views

Similar Articles

[PageSpeed] 40

<dwetmore@citcom.net> wrote in message 
news:pbico3pdtfva3i7op2opln6nubkfdqrs56@4ax.com...
>I have a series of combo boxes that the user will populate at runtime.
> I have trapped the "Enter" key to trigger the population code.
> However, the "Enter" key also moves the insertion point to the next
> combobox. I know I can alter Enter Key behavior for the whole
> database, but I would like be able to do it for the controls on one
> form which contains both  text boxes and combo boxes. I still want to
> be able to use Tab to move through the controls but want to disable
> the tabbing effect of the Enter Key
>
> How can I do this?
>
> Thanks
>
> Dave Wetmore

1. Set the form's KeyPreview property to Yes/True
2. Create a KeyDown event procedure for the form
3. In the procedure, type:

If KeyCode = 13 Then KeyCode = 0

That effectively 'throws away' the enter keypress.


0
Stuart
1/10/2008 5:15:09 PM
There is a much better way to do this.  Use the combo's After Update event to 
populate the combo dependent on the value of the current combo.  For example, 
the row source query of Combo2 could be something like:

   Select PooBah From tblBlah Where [Fizz] = Me.Combo1

Then in the After Update of Combo1

    If Not IsNull(Me.Combo1) Then
        Me.Combo2.Requery
    End If
-- 
Dave Hargis, Microsoft Access MVP


"dwetmore@citcom.net" wrote:

> I have a series of combo boxes that the user will populate at runtime.
> I have trapped the "Enter" key to trigger the population code.
> However, the "Enter" key also moves the insertion point to the next
> combobox. I know I can alter Enter Key behavior for the whole
> database, but I would like be able to do it for the controls on one
> form which contains both  text boxes and combo boxes. I still want to
> be able to use Tab to move through the controls but want to disable
> the tabbing effect of the Enter Key
> 
> How can I do this?
> 
> Thanks
> 
> Dave Wetmore
> 
0
Utf
1/10/2008 7:49:03 PM
Reply:

Similar Artilces:

data sort box too big-can it be formatted
Excel 2007? Sort Dialog box can be reduced to about 3 inch by 6 inch at smallest. Use sizing arrows to bring down to that size. Gord Dibben MS Excel MVP On Tue, 2 Jun 2009 09:27:01 -0700, Clee <Clee@discussions.microsoft.com> wrote: can it be formatted to stay the smaller size? I keep having to reduce it and it is annoying "Gord Dibben" wrote: > Excel 2007? > > Sort Dialog box can be reduced to about 3 inch by 6 inch at smallest. > > Use sizing arrows to bring down to that size. > > > Gord Dibben MS Excel MVP > > On Tue, 2 Jun ...

AfxMessageBox returns immediately without displaying the box
Hi, This is a pseudo code from InitInstance() of my dialog based app: if (cmdInfo.m_strAppName.IsEmpty()) { AfxMessageBox(IDS_SYNTAX, MB_OK | MB_ICONSTOP); // <= works fine! return FALSE; } try { /* ... */ CMyDlg dlg; m_pMainWnd = &dlg; INT_PTR nResponse = dlg.DoModal(); if (nResponse == IDOK) { /* ... */ // might throw CMyException } else if (nResponse == IDCANCEL) { // TODO: Place code here to handle when the dialog is // dismissed with Cancel } } catch (CMyException& e) { //...

search box
when I type any information in to the search box, a message comes back saying can not find this info?? That's on every thing I type in. "Fred" <Fred@discussions.microsoft.com> wrote in message news:04AB51B0-9AC7-4632-AB73-B9D315284594@microsoft.com... > when I type any information in to the search box, a message comes back > saying > can not find this info?? That's on every thing I type in. Which "search box" are you using, and what type of information are you seeking? -- Regards Steve. MS-MVP. MAIL. [DTS] UK. http://www.ge...

how to get all mails in box x that I have replied to
As the subject says, I would like to get ahold of all mails in a selected box that I have replied to. how does one do that kind of cross box checking? In news:1122886037.540223.144100@o13g2000cwo.googlegroups.com, pantagruel <bry@itnisk.com> typed: > As the subject says, I would like to get ahold of all mails in a > selected box that I have replied to. how does one do that kind of > cross box checking? Not sure what you mean by box - can you elaborate. Also, when you post in here, always include your version, SP level, and mode (if applicable) of Outlook - you can find th...

Why is Actual Work updated when entering time into Work Field?
We're using MS Project 2007 and seeing that sometimes when time is entered into the Work field for a task, that task's Actual Work is updated to the same value entered in the Work field. This happens to multiple resources, but only on some of their tasks and not on others. For example, for the weeks of 1/24 and 1/31, whatever hours I schedule (enter in the "work" cell in the Resource Usage View) for a given task also appears in the "actual" cell. The tasks are setup up differently. Some are Fixed Work, some are Fixed Duration. I believe all have the e...

Allen Browne's Search Screen clears the first record combo boxes
I am using Allen Browne's Search Screen and can't seem to stop the first record's entries being blanked out with the reset button. I changed the original cmdReset_Click() to only set the header fields to Null but my first record's fields also reset with each control. I am using combo boxes in the detail section (to display words instead of record id numbers) which isn't part of the original database. Can someone help? Greatly appreciated, Terri Terri, can you confirm whether: a) the data is being lost, or b) the data is not being displayed properly. There is a di...

Create an expression in a text box.
I have a text box on my form. I want to create an expression for a line item total (unit price * quantity * surcharge). I don't see the row source in the properties for a text box. How can I do this? "p-rat" <osupratt@yahoo.com> wrote in message news:6db31eb1-8255-496f-b176-5d7ebeb11621@q39g2000hsf.googlegroups.com... >I have a text box on my form. I want to create an expression for a > line item total (unit price * quantity * surcharge). I don't see the > row source in the properties for a text box. How can I do this? It's the ControlSource (or Control...

Help! Install Key Doesn't Work!
I have been happily using Microsoft Money Deluxe (version 17.00.1414) for over a year. I purchased a new computer several months ago and installed Money from the same install file (downloaded from Internet). I ignored the activation notice for weeks because I was too busy to fire up the old computer, but now am trying to activate it and it keeps failing. I used Belarc Advisor to retreive the install key from my old installation, but for some reason this install requires a key with a different format. The old format is xxxxx-xxxxx-xxxxx-xxxxx-xxxxx, but the new installation requir...

Onkey vs Macro Short cut key
Is there a benefit to using the macro short cut key in macro options vs coding a key combo using Onkey? Thanks Richard -- rgarber50 ------------------------------------------------------------------------ rgarber50's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=11350 View this thread: http://www.excelforum.com/showthread.php?threadid=385952 I don't think there is a huge difference but with the macro options approach the shortcut is almost always there. For instance it takes a macro to run to set the Onkeys but not for macro options. And to extend ...

Excel 2003 spreadsheet. I enter the any number and it is entered.
If I enter a number into a cell it is put in like a decimal. For example, if I enter 10 it is put in as .1 500 is entered as a 5 Thank you Mary Mary, Goto Tools>Options and on the Edit tab you should see The Fixed Decimal Places box checked. Uncheck it. -- HTH RP "maryu" <maryu@discussions.microsoft.com> wrote in message news:65C0E0FB-43F3-4F34-8A86-FBA3F02EC9B1@microsoft.com... > If I enter a number into a cell it is put in like a decimal. For example, if > I enter 10 it is put in as .1 500 is entered as a 5 > Thank you > Mary ...

Filter records by date in subform by date entered in mainform.
Hello, I've spent 3 days trying to understand what I'm doing wrong.....Here is the summary of my problem. I have a form named 'frm_EfficiencyStats' and a subform within the form named 'qry_Total hours subform' (the subform is based on a query). The form contains a text box (for date) which is bound to a table 'tbl_EfficiencyStats'. I would like to be able to enter a date in the text box on my form, and display the records in the subform based on the date I entered in the text box. The subform will only pull records from my table based on the date. Here are th...

produt key
i got the cd microsoft office 2003 but when i try it ask me for a 25 digit product key could you pls help me The product key should be with the CD. -- HTH Bob Phillips (remove nothere from email address if mailing direct) "hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh" <hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh@discussions.microsoft.com> wrote in message news:0E585FDC-301E-4759-9074-116902486905@microsoft.com... > i got the cd microsoft office 2003 but when i try it ask me for a 25 digit > product key could you pls help me > ...

how to enter simple list and sum
using excel 2002 with an xp sp2 system how would I enter a simple list of positive and negative numbers and then create a cell with the sum of these values? if the list would look like this 0.58 -1.22 1.79 -0.56 -0.92 the output would look something like 0.58 0.58 -1.22 -0.64 1.79 1.15 -0.56 0.59 -0.92 -0.33 John In B1 enter =A1 In B2 enter =B1+A2 Copy down to B5 Gord Dibben MS Excel MVP On Wed, 16 May 2007 06:34:13 +0300, "John" <johnj@multipl.es> wrote: >using excel 2002 with an xp sp2 system >how would I enter a simple list of positive and negative...

License/Install key- how to change....
Does anyone know how to change or delete the software key (ID)? I've installed Office with a key that was accidentally installed on another machine, so I have a duplicate, and I can't run both at the same time. I've purchased another license, but can't see how to get rid of the old key.<br> <br> I've tried to uninstall/reinstall, but that does not delete the software ID- does anyone know how to do this? Office 2008, see here: http://www.entourage.mvps.org/version/license_version.html#reset Office 2004, see here: http://www.mcgimpsey.com/macoffice/office/pid.ht...

Resource Units for Tasks entered in PWA differs than tasks entered in Project 2007
Hello, I have an ePM user asking why if he enters a project task in PWA does it not check the resource max units allocation the same way as when he enters a task in Project Professional. For example: You have a project where resource A is 50% allocated. When you create a task in Project Professional for this resource, the resource allocation is set to 50%. Create a task under the same project in PWA, submit and approve the task. Open project professional and view the task information for the task entered in PWA, why is the resource allocation set to 100% instead of 50% set for th...

Resizing row height to dynamically fit height of text box
Is there a way to link the height of a text box to the height of a row so that as you type text into the text box and the text box's height increases, the row height will also increase? I know That by setting the "Move and size with cells" option you can make the TEXT BOX height increase as the ROW height increases, but I'm looking to do the opposite (i.e. make the ROW height increase as the TEXT BOX height increases). Not too complicate things too much, but I was also hoping to do this within a protected sheet. "Jon" wrote: > Is there a way to link the...

Keep find box open while in spreadsheet
Hi... I was wondering how I can keep my find box open while I am entering and editing data in my spreadsheet. It is very frustrating to have to continually select the find option, type in what I want to find, close the window, do any changes or calcs, and then reopen to find the next. I am using Excel 2000. HELP!!!!! "Frantic Excel-er" <Frantic Excel-er@discussions.microsoft.com> wrote in message news:4DE2687C-BCDF-414A-979F-DE76F058B183@microsoft.com... > Hi... > I was wondering how I can keep my find box open while I am entering and > editing data in my spre...

Enter formula by code.
Hi All can anyone help. I cant seem to get this to work. I keep getting run time error 1004 application or object defined error. Public Sub TLIdentify() finalrow = Worksheets("INV Bookings").Range("B65536").End(xlUp).Row Worksheets("INV Bookings").Range("AV26:AV" & finalrow).FormulaR1C1 = "=IF(OR(RC[-38]>0,RC[-32]>0,RC[-26]>0,RC[-20]>0,RC[-14]>0,RC[-8]>0,RC[-2]>0),VLOOKUP(RC4,'Team Summary'!R4C3:R16C4,2,0),"")" End Sub -- Regards and Thanks for any assistance. Francis Brown...

Entering a dollar amount w/out having to enter the decimal
What is the formula to have Excel automatically enter the decimal so all I have to enter is the numbers? It's one of the options you can specify. In Excel 2007, it's: Excel Options...>Advanced>Automatically insert a decimal point Regards, Fred "Julieanne" <Julieanne@discussions.microsoft.com> wrote in message news:3AABE398-3B77-4ACD-8938-05ED7F5CC58E@microsoft.com... > What is the formula to have Excel automatically enter the decimal so all I > have to enter is the numbers? ...

How do I stop dates from being entered everytime I enter a number
Everytime I enter data in a box (ex: ages 5-9) I then press enter to go to the next cell and it automatically puts in may 9 . I have tried putting in general in formatting cells and it still does it. can someone help before I shoot this pc out the window? I am making a population pyramid with males and females and their ages. Thanks, Kicking and Screaming You can precede your entry with a single quote... '5-9 ....or format your cells as 'Text'. Hope this helps! In article <64AE5219-035D-46E3-9488-5D01F6B012FA@microsoft.com>, Kicking and Screaming <Kicking and...

message box without ok or cancel button
I need a customized message box without any response option, without OK or CANCEL or any other response button. Simply showing my macro is in process and do not disturb. Can anyone help me Can't see how you could do this with MsgBox, although you could of course create your own custom form. You would still need some way of closing it, and the X button at top-right would (normally) still be there. -- HTH Bob Phillips (remove nothere from email address if mailing direct) "Subash" <Subash@discussions.microsoft.com> wrote in message news:1C9A2BDD-1FBB-4530-A345-39B27A...

entering time #2
hello all.. wondering if there is any way to do this... I have a column formatted for time as in this format 12:00 when entering a time it is cumbersome to have to enter the hour, then a colon, then the minutes. Is it possilbe to simply enter a 4 digit number such as 1245 and have it show up as 12:45 ?? thanks so much... I've found this group to be irreplaceable... glen in orlando Enter your times without colons in column A and put this formula in column B =(A1-RIGHT(A1,2))/2400+RIGHT(A1,2)/(24*60) and format column B for "Time" in the form you want it. Tod "Glen i...

Odd Mailbox behavior
Hi, I have a user that has mailbox rights to her boss's mailbox. In addition, she has been granted full delegation rights thru his Outlook (2k3). All emails reside on the server, until Archiving performs its cleanup. Issue: The boss has subfolders under his inbox (all reside on server, no pst minus the Archive pst). He calls and requests that his admin assist move emails from his inbox to a subfolder. The email moves, but is gone the next day. If the boss performs the move, the email does not dissappear. What has been done: - verified she has full mailbox permissions on the...

Basing One Combo Box on Another
I have 2 combo boxes. Categories: A B C D ALL Jobs 1 2 3 I figured out how to make only the jobs associated with a specific category come up. Now I need to add to show all the jobs when I select category D. All JObs. I see how each job is connected to each category thru its own category code, but if I add another category code for "All Jobs" I will have to add that to the existing codes that are all ready pulling the correct jobs. Basically, If I select category D - I want to see all the jobs. Any suggestions would be greatly appreciated. Yula One approach to this would ...

Entering data
Please help me enter data into cells that seem to be locked. In article <15a201c43e09$dbea4e10$3501280a@phx.gbl>, "Alicia Contreras" <anonymous@discussions.microsoft.com> wrote: > Please help me enter data into cells that seem to be > locked. Hi Alicia, try: Tools > Protect > Unprotect Hope this helps! ...