Opening second Access DB's form with parameters

P_Henry

Registered User.
Local time
Today, 12:07
Joined
Dec 3, 2003
Messages
63
Hi,
:confused:
I am having problems opening a form in a standalone access DB using the the following code - I am able to open the second access DB but get an error indicating that ' The command or Action OpenForm isn't available now' - Run time error 2046.

Private Sub Command21_Click()

Dim strPathName As String
Dim stdocname As String

strPathName = "H:\Projects DB\PO KPI.mdb"
OpenADatabase (strPathName)

End Sub


Public Sub OpenADatabase(ByVal strPath As String)

Set appAccess = CreateObject("Access.Application")

With appAccess
.OpenCurrentDatabase strPath
.Visible = True
End With

appAccess.DoCmd.OpenForm "test", acNormal, , , , acWindowNormal


End Sub


Is it possible to open any form in the second database and pass parameters to it (From the first DB?)


Thanks,Priya
 
Last edited:

Users who are viewing this thread

Back
Top Bottom