Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Application won't stay visible

Status
Not open for further replies.

Beren1h

Technical User
Jul 19, 2001
104
0
0
US
Hello all,

Why does the following code not keep the access database opened visible when the button is clicked (it flashes for a second then goes away)?

Private Sub Command1_Click()

Dim App As New Access.Application

App.Visible = True

App.OpenCurrentDatabase "C:\TheDatabase.mdb"

End Sub

Thanks in advance...


 

1. Try putting App.Visible = True after the OpenCurrentDatabase command

2. Try adding:

App.DoCmd.RunCommand acCmdAppMaximize
App.DoCmd.Maximize
 
Nope.

I can see all of that functioning, but at the end the access window still disappears.
 
Yes, I just saw that and was just getting ready to post that solution.
If you are doing something like

app.DoCmd.OpenReport ReportName, lAction

then it will stay open even when the object variable looses scope...however, you cannot close it using the object variable (the user will need to close it).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top