Closing Form problem

J

Jos Vens

Hi,

I have a form (let's say Form1) and it has a button that opens another form
on top (let's say From2).

When I close Form2 (by pressing the cancel key, which unloads Form2), Form1
is also unloaded, which is not the purpose. Why is Form1 closed to? The
buttons to cancel the forms has different names, event-handling is set off).
I have debugged the code but there is no code that unloads Form1.

How can I prevent that Form1 is closed too?

Thanks
Jos Vens
 
R

Robin Hammond

Jos,

Without your code it's difficult to be sure, but the structure should look
something like this:

In Form1's code

Sub cmdShowOtherForm_Click()
Me.Hide
frm2.Show
Me.Show
End Sub

Robin Hammond
www.enhanceddatasystems.com
 
J

Jos Vens

Hi Robin,

is it necessary to hide the form1 when opening form2? I do it on other
places without closing form1 and it works. I rather like to not hide form1
because then you have a flikkering-effect. It's better to open form2 on top
of form1 and then unload it when I don't need it anymore (form2 just asks
for a password)

I guess it has something to do with the focus on form1, because it's not
always happening.

Jos
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top