exit form and close sheet

  • Thread starter Thread starter Doug
  • Start date Start date
D

Doug

I have a command button on a form that checks a password, if OK, it opens a
sheet. If I use the X on the top corner to close the form it opens the sheet
without checking the password. How do I close the sheet if the form is
exited. Thanks for the help.
 
I'm sorry, I'm a self taught rank amature at this. I don't understand your
suggestion. Can you give me some sample code please?
Thanks
Doug
 
Your existing code must somewhere have an instruction to show the form,
something like

MyForm.show

What you need to do is put the lines

dim bCanc as boolean
bcanc = false

Once the password has been checked and is valid, put the line

bcanc = True

in your code. Then finally, after the line MyForm.Show you need to put

if bcanc = false then exit sub

Sam
 

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

Back
Top