Open second database while closing first

Rats

Registered User.
Local time
Today, 20:12
Joined
Jan 11, 2005
Messages
151
I open a second database from my first one using the following code

Code:
Private Sub Command14_Click()
On Error GoTo Err_command14_Click

DoCmd.Close acForm, "client action amended", acSaveYes
Application.FollowHyperlink DLookup("[Link]", "links", "[linkname] = 'DebtProjector'")
CloseCurrentDatabase
Exit_command14_Click:
    Exit Sub

Err_command14_Click:
    MsgBox Err.Description
    Resume Exit_command14_Click
End Sub

to save having multiple databases open I have added the "closecurrentdatabase" command to the code.

However, instead of leaving one incidence of Access open and just closing the existing program it is creating a new one so I end up with multiple incidences of Access which gets messy as I need to come back to the first DB from the second as well.

I can see that the followhyperlink command is triggering another incidence of Access before the "closecurrentdatabase" is actioned but if I place this command in front of the followhyperlink command the database closes and the hyperlink doesn't run.

Any suggestions welcomed.

Peter
 

Users who are viewing this thread

Back
Top Bottom