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
> Close All Objects, Access 2010    
 
   
rzw0wr
post Feb 13 2020, 10:13 PM
Post#1



Posts: 371
Joined: 28-March 12
From: Indiana


Is there any way to close all objects at one time?

Is there a VBA way to use the Close All command like on the form close dialog box?

I have searched the internet but all of the code and explanations are over my head.


Thank you,
Dale

--------------------
Access 2010 32 bit.
Not really very good at access.
Go to the top of the page
 
theDBguy
post Feb 13 2020, 10:30 PM
Post#2


UA Moderator
Posts: 78,094
Joined: 19-June 07
From: SunnySandyEggo


Hi Dale. Which "objects" are you referring to? Is there a button for it now? If so, which one is it?

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
rzw0wr
post Feb 13 2020, 10:36 PM
Post#3



Posts: 371
Joined: 28-March 12
From: Indiana


Forms and reports.

No button I want to do it when the main menu form opens.

This is what I am using now.
It works but it does not close all the open forms.

CODE
Private Sub Form_Current()

Dim rpt As Report
Dim frm As Form

  For Each rpt In Application.Reports
    DoCmd.Close acReport, rpt.Name
  Next rpt
  For Each frm In Application.Forms
    If frm.Name <> "frmAAAAMain" Then
        DoCmd.Close acForm, frm.Name
    End If
    
  Next frm
  
End Sub


Thanks,
Dale
This post has been edited by rzw0wr: Feb 13 2020, 10:40 PM

--------------------
Access 2010 32 bit.
Not really very good at access.
Go to the top of the page
 
theDBguy
post Feb 13 2020, 10:40 PM
Post#4


UA Moderator
Posts: 78,094
Joined: 19-June 07
From: SunnySandyEggo


Okay, see if this Wiki function can help get you started in the right direction.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
rzw0wr
post Feb 13 2020, 10:47 PM
Post#5



Posts: 371
Joined: 28-March 12
From: Indiana


Well, I guess that wasn't too confusing.

Thanks for the link.
I will give it a try.

Thanks again DBguy, It appears to work just fine.

Thank you,
Dale
This post has been edited by rzw0wr: Feb 13 2020, 10:54 PM

--------------------
Access 2010 32 bit.
Not really very good at access.
Go to the top of the page
 
theDBguy
post Feb 13 2020, 11:28 PM
Post#6


UA Moderator
Posts: 78,094
Joined: 19-June 07
From: SunnySandyEggo


Hi. You're welcome. Good luck with the rest of your requirements.

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


Custom Search


RSSSearch   Top   Lo-Fi    25th May 2020 - 03:22 PM