Programming an exit key.

A

Antonio

I would like to place a button on a form that will close
the current database session and then re launch the
database bringin up the log in prompt. This would be
a "Change User" button that team members within our
department could use to switch users. If thats
impossible, could a button be programmed to first launch
the datbase and then close the current database the
button was clicked from?

Example:
Database is stored as "G:\MedRec Access
Program\kazimiera\Kazimiera.mdb"

Form Button A:
1st action: Close current database (Kazimiera.mdb)
2nd action: Re-Open Kazimiera.mdb (displaying log on
prompt.

Or
1st action: Open Kazimiera.mdb
2nd action: Close current database. (Kazimiera.mdb)

As it is now, the user has to completely close out of the
database and then click on the desk top short cut to
change users.
TIA
 
A

Albert D. Kallal

Try the following code. it should work


Dim strDB As String

strDB = Chr(34) & CurrentDb.Name & Chr(34)

Call Shell("start " & strDB, vbNormalFocus)
Application.Quit
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top