Setfocus on a subform
Setfocus on a subform
(OP)
I have a form with a subform, and the subform has a subform also. On the main form, in the form header section I have an unbound combo box from which the user must select a client. On the after update event of the combo box I want the focus to go to a record on the second subform so that data can be input directly.
All the references to how this should be done I have followed, but the focus remains on the combo box.
Here is a sample of my code.
[Deliveries].Form![Jobs]![ProductID].SetFocus
Thanks in advance
Umbane
All the references to how this should be done I have followed, but the focus remains on the combo box.
Here is a sample of my code.
[Deliveries].Form![Jobs]![ProductID].SetFocus
Thanks in advance
Umbane
RE: Setfocus on a subform
Try:
Forms!Mainform!Subform1.Form!Subform2.Form!ControlName
Check out:
http://www.mvps.org/access/forms/frm0031.htm
Missy Ed
Looking to exchange ideas and tips on VB and MS Access development as well as office 97 development. Drop me a line: msedbbw@hotmail.com
RE: Setfocus on a subform
Thanks for the help but it still does not move the focus to the desired field. Maybe I should try redesigning my form so that it doesn't need all the subforms.
Umbane
RE: Setfocus on a subform
If you want to go to a particular field:
DoCmd.GoToControl "SubFormName"
DoCmd.GoToControl "FieldName"
If you want to go to a new record:
DoCmd.GoToControl "SubFormName"
DoCmd.GoToRecord , , acNewRec
This has worked for me in the past, and the only help I could find on the subject, said to do it this way.
Jim Lunde
compugeeks@hotmail.com
Custom Application Development