VBA Code for Forms

Oorang

Well-known Member
Joined
Mar 4, 2005
Messages
2,071
Is there a way to interact with a form without opening it? (Ex getting all the control names)
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,300
Office Version
  1. 365
Platform
  1. Windows
I don't actually think so, but I'm not 100% sure.:eek:

I used to have code to go through every form in a database to change captions/labels etc on forms.

That was for Access 97 and I'm sure I needed to open the forms in design mode.

Now perhaps that's changed in later versions?

I'm afraid I lost the code some time ago but I'll see if I can find it again.

I know it's not on this machine, but perhaps I've posted it in some forum.

BTW what is it you are actually trying to do?
 

Oorang

Well-known Member
Joined
Mar 4, 2005
Messages
2,071
I inherited a database with literally thousands of tables, queries, forms, macros, etc. So I wrote up some code that will crawl the database and print out what is dependant on what so I know what is safe to delete and then I will start my redesign. However to do that acuratly I had to recursivly loop through every control in every subform (or subreport) and I was trying to avoid having to open the objects to do that. It's functional the way it is, but I was just trying to refine it becuase some of the forms have nested subforms 5 or 6 layers deep and the load time is high.
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,300
Office Version
  1. 365
Platform
  1. Windows
I'm afraid that to me that sounds like the only way to proceed.

Is it a one off deal?
 

Oorang

Well-known Member
Joined
Mar 4, 2005
Messages
2,071

ADVERTISEMENT

Well yes and no. Given my line of work, the ability to document a database like this is valuable enough that I could see the code being used repeatedly.
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,300
Office Version
  1. 365
Platform
  1. Windows
Well if it's a documentation thing I think you should just probably stick with opening etc.

I know it'll probably be a pain but I can't think of any other way.:)

I used to have a database that was solely code for this sort of thing, but I've lost it somewhere.

Why not create such a database?
 

Forum statistics

Threads
1,137,333
Messages
5,680,881
Members
419,937
Latest member
Talic

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top