Solved

Form  --> design tools choose object -- do it in vba while the form is in design mode

Posted on 2016-10-16
2
34 Views
Last Modified: 2016-10-17
Access 2010

Is there a way IN VBA to set focus to a control while the form is in DESIGN MODE?

If a from is in design mode, and you use the ribbon --> "Form Design Tools" /Format   there is an object pull down list that you can find your control and Access will put you on that control (while the form is in design mode) when you pick the control from the list.

Thanks in advance for your help
LJG

------------- The below is not important - but I know you are going to ask why ------------------
I have a tab control with about 25 pages on the control.
                    Tab Fixed Width =0
                    Tab Fixed Height =0
                    Style None
I get to the tabs from buttons on the form

I am redoing most of the pages, where I am moving controls etc to different pages of the controls.
It would be much easier if in code (while the form is in design mode) I could do something like --->   Forms!Tab_1.SetFocus.
Where the tab control name is ---> Tab_Ctl_1    and the pages are --->  Tab_1 /  Tab_2    etc.
0
Comment
Question by:LJG
2 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 41845774
You probably could using the VBE library, but ... by the time you develop and test the code, you will have invested a LOT more time and effort into doing that than you would just doing it manually. I seriously doubt this would be "reusable" code, since you'd have to get pretty specific about control containers, levels, etc etc ... so, again, the ROI would seem to be nonexistent (or even in the negatives, to a very large degree).

I do believe, however, that MZTools has a "Copy Control With Code" feature, which may do what you're after:

www.mztools.com
0
 
LVL 2

Author Comment

by:LJG
ID: 41847094
Thanks Scott

I'll take your advice.  I did add the Object combo to the Quick Access Toolbar.

LJG
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

758 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

18 Experts available now in Live!

Get 1:1 Help Now