PDA

Click to See Complete Forum and Search --> : VB pgm won't close


joedoer
May 14th, 2000, 07:48 PM
My vb pgm runs multiple queries and a report from within an
Access mdb but I can't get the vb pgm to close automatically when it's done. I have to click the close (X) button on the form to end it.
Any ideas?

On Error GoTo error1

'Center form on screen
Left = (Screen.Width - Width) \ 2
Top = (Screen.Height - Height) \ 2

Set msacs = New Access.Application
msacs.OpenCurrentDatabase "F:\User Files\holly\Access\Expediting.mdb"
msacs.Visible = False

msacs.DoCmd.RunMacro "RunReport"
msacs.CloseCurrentDatabase

Unload Me

error1:

Clunietp
May 15th, 2000, 12:50 AM
Assuming msacs is an instance of an Access Application object, put this at the end of your code

set msacs = nothing

to release the object reference to the application object