Solved

Reorder all controls in form

Posted on 2014-01-06
2
423 Views
Last Modified: 2014-01-06
Hi Experts,

I'm using code

For Each ctl In Forms... to change the name of all the controls in a form.
That works fine, the problem is that the controls are in the wrong order, how do I change that? Changing the Tab Order doesn't work.

Gary
0
Comment
Question by:tbsgadi
[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 48

Accepted Solution

by:
Dale Fye earned 500 total points
ID: 39759301
The controls show up in the controls collection in the order they were created, so if you want to loop through them in a specific sequence (tab order), you are probably going to have to setup a temp table to store the name of the control and the tab order.  

Then create a recordset based on that table and sorted by tab order to get them in the sequence you want them in, before doing your sequential renumbering.
0
 
LVL 46

Author Closing Comment

by:tbsgadi
ID: 39759498
Thanks, I just found it easier to add the textboxes from scratch.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
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…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

628 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