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

Coosing which form to open...

Status
Not open for further replies.

elziko

Programmer
Nov 7, 2000
486
GB
I have a VB program that when run opens a form. This means that once the exe is built and run the form opens as expected.

However, under certain circumstances I want a different form to open. Is there anyway to do this from a command line so that I could do something like:

"my_compiled_prog.exe" which will open on form1

and

"my_compiled_prog.exe s" which will open on form2?

Thanks in advance

elciko
 
customize to fit your need
just keep in mind "-" is reserved so check for it

Sub Main()
Dim x As String
x = Command$
x = Trim(x)
x = Left(x, 1)
MsgBox "" & x
Select Case x
Case 1
Form1.Show
Case 2
Form2.Show
End Select
End Sub

Good Luck!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top