Opening second Access DB's form with parameters

P

Priyahenry

Hi,

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
 

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