From: Alex Hammerstein on
Hi I have a close button which when pressed I want to give the user the
option to close the database and leave Access open, or close the database
and quit Access

IS this possible please - I can get the Application quit bit but not the
syntax to close the Database and leave Access open

Tks

From: BruceM via AccessMonster.com on
Why not just use two command buttons? Presumably the user knows in advance
which option they want, so why make them click both the command button and a
message box?

That said, from what I can tell you can use Application.CloseCurrentDatabase
or Application.Quit, so you could present the user with a message box:

If MsgBox("Close Access? Click No to close just this database.", _
vbYesNo,"Make a Choice") = vbYes Then
Application.Quit
Else
Application.CloseCurrentDatabase
End If

Alex Hammerstein wrote:
>Hi I have a close button which when pressed I want to give the user the
>option to close the database and leave Access open, or close the database
>and quit Access
>
>IS this possible please - I can get the Application quit bit but not the
>syntax to close the Database and leave Access open
>
>Tks

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201002/1

From: Alex Hammerstein on
Thanks

A


On 16/02/2010 12:43, in article a3b7fe484f9f3(a)uwe, "BruceM via
AccessMonster.com" <u54429(a)uwe> wrote:

> If MsgBox("Close Access? Click No to close just this database.", _
> vbYesNo,"Make a Choice") = vbYes Then
> Application.Quit
> Else
> Application.CloseCurrentDatabase
> End If