Click to See Complete Forum and Search --> : Easy Question


tkbr0wn
October 17th, 2001, 10:36 AM
I am very new to VB and I have written a SQL-DMO app that has a GUI interface and a command line interface. I have created a SUB main and made it the startup. Here it is


Sub Main()
' If there is a command line, then this is batch mode
If Len(Command$()) Then
' Parse and run the command line
RunCommand
frmRun.Hide

Else
MainForm.Show
End If
End Sub

Problem is after the frmRun.Hide, the form hides but the exe keeps running. What do I do?

Thanks in advance

Cimperiali
October 17th, 2001, 10:44 AM
>Problem is after the frmRun.Hide, the form hides but the exe keeps running.
Do yopu mean program does not end? Matter is: hiding a form, make it invisible, but keep it loaded.
To end your program, you have to unload all loaded forms
ie:

Unload frmRun

'or
dim frm as form
for each frm in forms
unload frm
set frm = nothing
next frm




Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Michael
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.

The Rater

tkbr0wn
October 17th, 2001, 10:53 AM
Thanks, that was it.

Kenny