 |
| Access VBA Discuss using VBA for Access programming. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

January 26th, 2010, 02:15 PM
|
|
Authorized User
|
|
Join Date: Feb 2009
Posts: 25
Thanks: 11
Thanked 0 Times in 0 Posts
|
|
Exit database button to close Access
I have solved the problem. thanks to all who replied.
Last edited by billy1r; March 23rd, 2010 at 01:11 PM..
|
|

February 8th, 2010, 05:56 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
|
|
What would you like it to do instead?
__________________
Greg Serrano
Michigan Dept. of Environmental Quality
Air Quality Division
|
|
The Following User Says Thank You to SerranoG For This Useful Post:
|
|
|

February 8th, 2010, 11:34 PM
|
|
Authorized User
|
|
Join Date: Feb 2009
Posts: 25
Thanks: 11
Thanked 0 Times in 0 Posts
|
|
Exit Database Button to CLose Access
I would like the botton on the second page to go back to the first page only, not exit the application, which is what it does! To get back to the first page of my switchboard, I have to restart the database.
|
|

February 9th, 2010, 08:47 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
|
|
Bear with me as I understand your switchboard.
Is your switchboard one form that scrolls down to two halves? Are your switchboards two sepearate forms that open? If they are two forms, are they open at the same time or does Page 1 close when you open Page 2?
__________________
Greg Serrano
Michigan Dept. of Environmental Quality
Air Quality Division
|
|
The Following User Says Thank You to SerranoG For This Useful Post:
|
|
|

February 9th, 2010, 09:58 AM
|
|
Authorized User
|
|
Join Date: Feb 2009
Posts: 25
Thanks: 11
Thanked 0 Times in 0 Posts
|
|
Exit Database Button to Close
My switchboard is 2 separate pages. Page 1 closes when page two opens. There is a button on page two which will take you back to the main page (page 1). Since I added that code, that button also closes the database and exits the application. I have tried taking that code out. But when I do my database doesn't work properly.
I am new at VBA for Access so I don't really understand it all yet although I am studying it at this time.
|
|

February 9th, 2010, 10:25 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
|
|
Open Pages 1 & 2 at the same time but make Page 1 open second so that it's on top of Page 2. Don't close either.
When on Page 1, the button just activates Page 2 and vice-versa
Forms.Page1.Form.Activate
or
Forms.Page2.Form.Activate
Have yet ANOTHER button on each form that closes the whole database separate from the page-toggling buttons.
DoCmd.Quit
__________________
Greg Serrano
Michigan Dept. of Environmental Quality
Air Quality Division
|
|
The Following User Says Thank You to SerranoG For This Useful Post:
|
|
|

February 9th, 2010, 10:27 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
|
|
Oh, and replace Page1 and Page2 in my code for your real form names.
Forms.Your_Real_Form_Name_Here.Form.Activate
__________________
Greg Serrano
Michigan Dept. of Environmental Quality
Air Quality Division
|
|
The Following User Says Thank You to SerranoG For This Useful Post:
|
|
|

March 22nd, 2010, 05:50 AM
|
|
Authorized User
|
|
Join Date: Nov 2005
Posts: 41
Thanks: 6
Thanked 1 Time in 1 Post
|
|
Or you could use
Code:
docmd.openform "your_page_1", acform
docmd.close acform, "your_page_2", acSaveYes
on the button on page 2. That ought to do it.
__________________
Rob Carter
|
|
The Following User Says Thank You to RobCarter For This Useful Post:
|
|
|
 |