Access 2003 Tab orders and SetFocus

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
MSALLCAsked:
Who is Participating?
 
ragoranConnect With a Mentor Commented:
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
 
ragoranCommented:
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
 
MSALLCAuthor Commented:
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
 
MSALLCAuthor Commented:
Perfect, Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.