Solved

How to close an open  Microsoft Access file with vba

Posted on 2013-05-28
3
2,259 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

810 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