?
Solved

Access 2003 Tab orders and SetFocus

Posted on 2007-10-15
4
Medium Priority
?
518 Views
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?

Forms!frmReceiving!sfrmInventoryControl!QuantityReceived.SetFocus
0
Comment
Question by:MSALLC
  • 2
  • 2
4 Comments
 
LVL 14

Expert Comment

by:ragoran
ID: 20080864
This syntax is wrong:
Forms!frmReceiving!sfrmInventoryControl!QuantityReceived.SetFocus

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

Forms!frmReceiving!child1.form!QuantityReceived.SetFocus

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

me.child1.form!QuantityReceived.SetFocus


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

Author Comment

by:MSALLC
ID: 20081470
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?
0
 
LVL 14

Accepted Solution

by:
ragoran earned 2000 total points
ID: 20085711
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:

me.child.setfocus
me.child1.form!QuantityReceived.SetFocus
0
 

Author Comment

by:MSALLC
ID: 20087440
Perfect, Thanks
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
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…
Suggested Courses

809 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