ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Forms that open from forms (https://www.excelbanter.com/excel-programming/313331-forms-open-forms.html)

Azza

Forms that open from forms
 
Hi there

I have a form that opens from a form with the other form remaining
open.

I use the form.hide command to go back to the original form, but it
does not go through the "initialize" code if I bring the form back up
and this is causing trouble.

How do I close the second form so that it does not close the first
form but initializes each time it is accessed with the first form
staying open

i.e: open form 1
open form 2 from a button on form 1
close form 2 - WHAT code to do this so that ..
open form 2 from a button the button on form 1
- form 2 opens using the initialize code.

using hide does only hides the form (dah-me) and then shows it when i
trigger the show code, but does not go through the initialize code - I
need to force the initalization each time.
cheers
Aaron

Bob Phillips[_6_]

Forms that open from forms
 
Hi Aaron,

It won't go through the initialise code unless it is unloaded, and it won't
go through the activate code unless it gets shown again.

Try something like

Form1.
Unload Me
UserForm2.Show

Form 2.
Unload Me
UserForm1.Show

--

HTH

RP

"Azza" wrote in message
m...
Hi there

I have a form that opens from a form with the other form remaining
open.

I use the form.hide command to go back to the original form, but it
does not go through the "initialize" code if I bring the form back up
and this is causing trouble.

How do I close the second form so that it does not close the first
form but initializes each time it is accessed with the first form
staying open

i.e: open form 1
open form 2 from a button on form 1
close form 2 - WHAT code to do this so that ..
open form 2 from a button the button on form 1
- form 2 opens using the initialize code.

using hide does only hides the form (dah-me) and then shows it when i
trigger the show code, but does not go through the initialize code - I
need to force the initalization each time.
cheers
Aaron





All times are GMT +1. The time now is 12:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com