Solved

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

Posted on 2016-10-16
2
68 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

752 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