SetFocus Code

B

bdehning

How would one write the setfocus code for a control on a second level subform

I have Form "Account Information" with a subform "Location" and Location has a subform "Service Calls".

If I want to setfocus to "Scheduled Service Month" on "Service Calls", How would I structure this

Thank you to everyone who assists us with issues. It is greatly appreciated.
 
G

Graham R Seach

Forms![Account Information]!Location.Form![Service
Calls]!somecontrol.SetFocus
or
Me![Location].Form![Service Calls]!somecontrol.SetFocus

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.html


bdehning said:
How would one write the setfocus code for a control on a second level subform?

I have Form "Account Information" with a subform "Location" and Location has a subform "Service Calls".

If I want to setfocus to "Scheduled Service Month" on "Service Calls", How would I structure this?

Thank you to everyone who assists us with issues. It is greatly
appreciated.
 
B

bdehning

Both gave me errors like Location field does not exist when location is subform or a compile erro

----- Graham R Seach wrote: ----

Forms![Account Information]!Location.Form![Servic
Calls]!somecontrol.SetFocu
o
Me![Location].Form![Service Calls]!somecontrol.SetFocu

Regards
Graham R Seac
Microsoft Access MV
Sydney, Australi

Microsoft Access 2003 VBA Programmer's Referenc
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.htm


bdehning said:
How would one write the setfocus code for a control on a second leve subform
appreciated
 
B

bdehning

Graham

Thanks for the help. I was able to tweak your code and make it work.

Forms![Account Information].SetFocu
Forms![Account Information]![Location].SetFocu
Forms![Account Information]![Location]![Service Calls].SetFocu
Forms![Account Information]![Location]![Service Calls].Form![Scheduled Service Month].SetFocu


----- Graham R Seach wrote: ----

Forms![Account Information]!Location.Form![Servic
Calls]!somecontrol.SetFocu
o
Me![Location].Form![Service Calls]!somecontrol.SetFocu

Regards
Graham R Seac
Microsoft Access MV
Sydney, Australi

Microsoft Access 2003 VBA Programmer's Referenc
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.htm


bdehning said:
How would one write the setfocus code for a control on a second leve subform
appreciated
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top