Closing tables etc using VBA

jack1234

Registered User.
Local time
Today, 00:15
Joined
Jun 2, 2007
Messages
16
I wish to detect is there any opened tables, queries, forms, reports, pages(item that may potentially locked the table), and close them automatically using VBA. How to do this?
 
What ways have you tried? What roadblocks have you hit? Where in the process are you stuck? Have you attempted this? We want to help, sure, but not necessarily provide the full answer.

You have to attempt this on your own and then say, "OK, I can get it to this point, but then I get stuck." If you're 100% new to VBA, then someone (myself or anyone else) just writing the code for you does nothing to advance your knowledge of how to answer these questions on your own.
 
Thanks for the comment. I just need a pointer for starting.
To share with you, I just know
Dim obj as AccessObject
For Each obj In CurrentData.AllTables//AllForms etc,etc
If obj.IsLoaded Then
DoCmd.Close acTable, obj.Name
End If
Next obj
can do the job.
 

Users who are viewing this thread

Back
Top Bottom