Opening Form in second access database

P_Henry

Registered User.
Local time
Today, 19:05
Joined
Dec 3, 2003
Messages
63
Hi,

I am having problems opening a form in a standalone second 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
 
Uncle Gizmo,

Thank you for your response. I have downloaded the B/E and F/E databases. I will have a closer look at the code!
Thanks,
Priya
 

Users who are viewing this thread

Back
Top Bottom