Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 151
  • Last Modified:

Close statement not working

If anyone has any experience with VBA you could help me out greatly.
Here's the way it goes, i have 3 forms.  in each form is an if statement that jumps up to the next form in a certain hierachry.  Form1 is the first form loaded, then Form2 and then Form3.  So, once these forms have been opened, i need to be able to close them and continue code execution on the previous form.
'form1 stuff
Commandbutton_click
     form2.show
     'stuff that needs to be exectued after form2 is done running
end sub

'form2 stuff
commandbutton_click
     form3.show
     'stuff that needs to be executed after form3 is done running
     close
end sub

'form3 stuff
commandbutton_click
     'stuff that form3 runs
close
end sub

the problem is that the Close statement is not closing the form like it's, seemingly, supposed to.  if i do an End statement, all of the forms close and no further code exectution takes place.  how do i get the forms to close themselves when the buttons are clicked?! i can't figure it out.  thanks

     
0
kidgenius2002
Asked:
kidgenius2002
  • 2
1 Solution
 
aeklundCommented:
close does not close forms... it closes files..

use "Unload Me" instead or "Unload <form>"
0
 
kidgenius2002Author Commented:
oik, that's pretty damn messed up b/c i had tried the whole
unload <form>
unload userform
etc

some sick programmer is laughing now b/c u have to type "Unload Me"

argh

thanks man
0
 
aeklundCommented:
<g>... (microsoft is the one laughing I guess)

glad to help
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now