Access 2003 Tab orders and SetFocus

Posted on 2007-10-15
Last Modified: 2013-11-28
I am working on a form that will allow me to update the Quantities Received. I have a combo box that "Finds a record on my form based on the value I selected in my combo box". The problem I'm having is that the cursor or focus will not move from this box except by using the mouse. I have tried using this setfocus statement on the after update and the on dirty. I have used the step into debug function and it is being looked at by the database but the focus is not moving. Even the enter and tab keys from the keyboard will not move the focus. Any suggestions?

Question by:MSALLC
    LVL 14

    Expert Comment

    This syntax is wrong:

    ------------------------------^ this should be the name of the control containing the subform, not the name of the form, then you should have .form


    further more, if you are running this code from the frmReceiving form, it can be simplify as:


    Note that in both example, you have to replace child1 by the actual control name.

    Author Comment

    Thanks for your response, I have tried both suggestions. I am having to added this code to the after update event that also has the code that access build by the combo box wizard. I have tried adding this code infront and behind the wizard code. In all attempts the focus does not move from the combo box even when I use the enter or tab key from the keyboard. It only changes with mouse control. Is there some other property setting that may cause this?
    LVL 14

    Accepted Solution

    For the problem about manually tabing to the control, Check the "Tab stop" property of both the subform control and the combobox you need to set focus to.  It should be set to true.

    Then I forgot that to set focus to a control on a subform, you first have to set focus to the subform itself:


    Author Comment

    Perfect, Thanks

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Suggested Solutions

    The first two articles in this short series — Using a Criteria Form to Filter Records ( and Building a Custom Filter ( — discuss in some detail how a form can be…
    Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
    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…
    What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

    729 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

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now