Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2016-10-16
2
Medium Priority
?
79 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 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

715 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