Hi everyone

I am relearning to use VB after taking classes almost 10 years ago. I am stumped on remebering how to open a file using a command button.

I have created some forms using VB that I want to activate from a main menu. I have made them .exe files and just want to navigate from one to another.

Thanks - John

Recommended Answers

All 2 Replies

Does this help?

Dim TaskID As Long
    TaskID = Shell(pathname\filename.exe, vbNormalFocus)

Hi everyone

I am relearning to use VB after taking classes almost 10 years ago. I am stumped on remebering how to open a file using a command button.

I have created some forms using VB that I want to activate from a main menu. I have made them .exe files and just want to navigate from one to another.

Thanks - John

Assume you are using VB 6 ... use the online help or MSDN and look up SHELL command ... but why did you make the forms into separate exe files? Using your main menu form you could code:

IF someoption is selected then
LOAD frm_name
frm_name.SHOW
Endif
the above will bring the form up and it will have the focus... now for some finesse in the new form's LOAD subroutine

main_menu_form.HIDE

in the new forms Query_Unload sub

main_menu.shw

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.