Solved

How to close an open  Microsoft Access file with vba

Posted on 2013-05-28
3
2,156 Views
Last Modified: 2013-05-28
hi

I want that when I open a form in ACCESS it's  will give me an option to closing the current file. Is there a possibility in vba to do this?










I want that in some cases when I open a form ACCESS platform that will give me a chance to closing the file. Is there a possibility in vba closing the current file
0
Comment
Question by:bill201
  • 2
3 Comments
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
ID: 39200998
Not sure I understand your question.   Normally in VBA, you do:

Application.Quit

or

DoCmd.Quit

 to close and exit MS Access.

If you want to open another DB, the current one is automatically closed when the new one is opened.  In the Access UI, you can only have one DB open at a time.

 In code, you can open/close multiple databases (OpenDatabase() ).

Jim.
0
 

Author Comment

by:bill201
ID: 39201060
You understand what I mean, I wanted to close the current file in your code "docmd.quit" worked well many thanks
0
 

Author Closing Comment

by:bill201
ID: 39201061
You understand what I mean, I wanted to close the current file in your code "docmd.quit" worked well many thanks
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

This article explains all about SQL Server Piecemeal Restore with examples in step by step manner.
CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now