UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Make Table Or Export To Excel - All Form Names In Current Project - VBA, Access 2016    
 
   
KristaC
post Nov 29 2017, 12:27 PM
Post#1



Posts: 70
Joined: 5-February 15



Hi All,

I'm building a fairly large db and I'm wanting to put a cmd btn on an admin developer form that, onclick, will output to Excel (and put it right on my c: desktop) a list of all forms (I guess that would be the form name or form caption?) in my current project (will it also list subforms?)? Another option would be to have the button make a table right in the project with a list of form names.

Oh my...can you see my brain spinning with the questions in the question?

Anyone know the VBA that might be written on the onclick event of the button?

Would really much appreciate your help! Have a lot of forms and I want the ability to have them in excel and notate them.

Have an awesome day...
Go to the top of the page
 
theDBguy
post Nov 29 2017, 12:33 PM
Post#2


Access Wiki and Forums Moderator
Posts: 71,233
Joined: 19-June 07
From: SunnySandyEggo


Hi,

Here's one way to list all the forms in the Immediate Window.

CODE
Dim var As Variant

For Each var In CurrentProject.AllForms
    Debug.Print var.Name
Next

Hope it helps get you started...

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Microsoft Access MVP | Access Website | Access Blog | Email
Go to the top of the page
 
KristaC
post Nov 29 2017, 12:34 PM
Post#3



Posts: 70
Joined: 5-February 15



Hi. Thanks much. Is there any way to have the info not just land in the immediate window but actually export that info to an excel table?
Go to the top of the page
 
theDBguy
post Nov 29 2017, 12:54 PM
Post#4


Access Wiki and Forums Moderator
Posts: 71,233
Joined: 19-June 07
From: SunnySandyEggo


Yes, for example, you can use Excel automation. Or, you can also create a query like the following and then export it to Excel.

SELECT [Name] FROM MSysObjects WHERE [Type]=-32768

Hope it helps...

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Microsoft Access MVP | Access Website | Access Blog | Email
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    17th December 2017 - 01:21 AM