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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trying to open an mde program file in VB

Status
Not open for further replies.

Zeroanarchy

Technical User
Jun 11, 2001
630
AU
Thanks for taking the time to look over this.

What I am trying to do here is close the VB program and run an access program, the problem I am having with this code is:

It opens the database ok, but it then automaticly minimizes it then after about .2sec it automaticly closes it. What I am trying to have happen is close the exe file and keep the access program open at maximize.

Private Sub sampleLabel_Click(Index As Integer)
Dim applAccess As Access.Application

Set applAccess = New Access.Application
applAccess.OpenCurrentDatabase "D:\sbs\Current Programs\Service Ware\Servic~2.mde", True
applAccess.DoCmd.OpenForm ("autoexec")
Unload me
End Sub

Any ideas, thanks

Zero Anarchy


 
Hi Zero Anarchy,

Did you try one of the following before you unload your program:

applAccess.DoCmd.Maximize
applAccess.Visible = True

Nath
 
nath, added you surgestion to the code, and what happens is it know maximizes until the form comes up once the form is up it automaticly minimizes then shuts down.
I removed the unloadme from the code and the same prob still exists.

My Reference is:Microsoft Access 8.0 object library
Microsoft DA) 3.51 object library

Any Ideas.

Zero
 
Hi Zero,

Unfortunately I don't have VB6 installed on my PC here and can only try with VBA on Excel and it works fine for me (instead of "Unload Me" I use "Application.Quit"). I may have a look to VB6 over the week-end.

A couple of suggestions though:

Try

applAccess.OpenCurrentDatabase "D:\sbs\Current Programs\Service Ware\Servic~2.mde", FALSE

Instead of TRUE

Also, do you absolutely need the "Unload me"? What kind of application is it? Is the exe not going to die by itself? What happens if you do not Unload?

Nath
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top