Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to close an open  Microsoft Access file with vba

Posted on 2013-05-28
3
Medium Priority
?
2,543 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 58

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

916 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