gbnorton
asked on
Open a form in another database problem
I use this code to open a form in another database:
Private Sub btnOpenPlatinumTraveler_Cl ick()
Dim objACC As New Access.Application
Set objACC = GetObject("T:\Diode Travelers Application\Source\DiodePl atinumDiff usionTrave lerApplica tion.accdb ")
objACC.DoCmd.OpenForm ("Switchboard"), acNormal
' objACC.Quit
' Set objACC = Nothing
End Sub
But it opens the form and closes it immediately. I can use a breakpoint at End Sub to see the form is open. And I can use it normally.
What needs to be done to keep the form open?
Thanks,
Brooks
Private Sub btnOpenPlatinumTraveler_Cl
Dim objACC As New Access.Application
Set objACC = GetObject("T:\Diode Travelers Application\Source\DiodePl
objACC.DoCmd.OpenForm ("Switchboard"), acNormal
' objACC.Quit
' Set objACC = Nothing
End Sub
But it opens the form and closes it immediately. I can use a breakpoint at End Sub to see the form is open. And I can use it normally.
What needs to be done to keep the form open?
Thanks,
Brooks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks Capricorn
Please look for my follow up question about having the form open up on top...
Brooks
Please look for my follow up question about having the form open up on top...
Brooks
please define the variable objAcc on your form level, and it shall work.
and you might then check if objAcc is already set , and reuse it if you are to open several forms of that same other database ...