Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

MS Access Form OnKeyDown Event with Text Boxes Not Working Properly

Posted on 2013-01-31
3
Medium Priority
?
606 Views
Last Modified: 2013-01-31
Hello,

So I have a form that filters records in the top section based what information is filled into  combo and text boxes.

I have added an OnKeyDown event to each of these combo and text boxes and when I press the Enter key after putting in one of the values into the combo boxes, it works perfectly. However, when I press the Enter key after puttin in one of the values into the text boxes, it tabs over to the next box and then I would have to press Enter a 2nd time for it to begin the query.

I am kind of figuring out VBA a little through working with it in this form. Can you please let me know what I would have to do for it to work properly (that is, press Enter key on any of the boxes in top section and have it filter the results in the subform)??
Form-Building-Using-FiltersRev-4.accdb
0
Comment
Question by:IEHP1
  • 3
3 Comments
 

Accepted Solution

by:
IEHP1 earned 0 total points
ID: 38841508
I believe I have figured it out.....

If I change the Forms command button DEFAULT property to YES, it will work, but let me test this first.......
0
 

Author Comment

by:IEHP1
ID: 38841522
YEP, I answered my own question. Sorry about the post, I guess more Knowledge to the Knowledge Base.....
0
 

Author Closing Comment

by:IEHP1
ID: 38841528
Set DEFAULT Property o YES in order for your Command button to Activate when press Enter key in a text box.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question