Solved

How to close an open  Microsoft Access file with vba

Posted on 2013-05-28
3
2,341 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

As technology users and professionals, we’re always learning. Our universal interest in advancing our knowledge of the trade is unmatched by most industries. It’s a curiosity that makes sense, given the climate of change. Within that, there lies a…
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
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…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

734 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