Open a form form a form

Right basically i have written a program in VB which runs when a user logs in and shows them an acceptable use policy, what i have is 2 buttons, 1 decline = logs them off and the over accept which maps there drives, what i want to do is create a new form with this policy (which is 6 pages long), and add a 3rd button on the main screen, that when pressed show the use policy but keeps the original form open. I know very very little about VB, am using VB6. Thank You
Who is Participating?
TimCotteeConnect With a Mentor Commented:
Hi dbaker1201,

I am not sure I entirely understand but anyway:

Private Sub cmdShowUsePolicyForm_Click()
  frmSecondForm.Show vbModal,Me
End Sub

Would show your second form, waiting until it is closed before releasing control back to the first form (remove vbModal,Me to make this an independent form).

So you would have three command buttons on the first form one of which is the button as above, this displays presumably the entire policy with a "Close" button. In the close button's click event you need to have :

Private Sub cmdClosePolicy_Click()
  Unload Me
End Sub

This will return control back to the main form.


Brainbench MVP for Visual Basic

Experts-Exchange Advisory Board Member
dbaker1201Author Commented:
Excellent, Thank You, One more thing.

I am adding a lot of functions eg, finding ip addresses and mapping drives, but unless i copy over the correct dll's i get an error from my program when run on a different computer, is there a way round this, can the files be storred in the program, please help this is doing my head in
You need to create an installation package for your application. VB provides the P&D (package and deployment) wizard which can be used to create a setup-based installation package. Your required components are included in a .CAB file and a small installer executable (setup.exe) is also created along with setup.lst which contains details for the installation. Simply run through the wizard ensuring that all your required files are included (99.8% of the time they will be automatically detected). Then make this available somewhere to be installed from (a network share is a good place). You can then run the setup.exe (as an administrator of course) on each machine and all required components will be installed and registered on each machine. Your application will then run quite happily.
All Courses

From novice to tech pro — start learning today.