If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Open Database with hyperlink. Close the current one
Ive got a form set up in a database with a label hyperlinked to open up
another database when clicked. Is it possible to make it so that the current database closes when the new one opens |
#2
|
|||
|
|||
Open Database with hyperlink. Close the current one
Private Sub ButtonName_Click()
Call Shell(Path to other database, 1) DoCmd.Quit End Sub eg Private Sub ButtonName_Click() Call Shell("""C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE"" ""C:\MyDocuments\MyDatabase..mdb", 1) DoCmd.Quit End Sub -- Wayne Manchester, England. "mark909" wrote: Ive got a form set up in a database with a label hyperlinked to open up another database when clicked. Is it possible to make it so that the current database closes when the new one opens |
#3
|
|||
|
|||
Open Database with hyperlink. Close the current one
"mark909" wrote in message
... Ive got a form set up in a database with a label hyperlinked to open up another database when clicked. Is it possible to make it so that the current database closes when the new one opens You can't do this with a hyperlink. You could have an autoexec macro (or startup code) in the newly opened database automatically locate and close the application window that had the previous database open. Or (better, to my way of thinking) you could use code like this in the first database to open the new database and close the current one: '----- start of example code ----- Private Sub cmdSwapDB_Click() Dim strNewDatabase As String strNewDatabase = "C:\Users\Mark\Documents\NewDB.mdb" Shell "msaccess.exe " & Chr(34) & strNewDatabase & Chr(34), vbNormalFocus DoCmd.Quit acQuitSaveNone End Sub '----- end of example code ----- -- Dirk Goldgar, MS Access MVP www.datagnostics.com (please reply to the newsgroup) |
Thread Tools | |
Display Modes | |
|
|