?
Solved

Close statement not working

Posted on 2003-03-06
3
Medium Priority
?
147 Views
Last Modified: 2011-09-20
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
Comment
Question by:kidgenius2002
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 10

Accepted Solution

by:
aeklund earned 200 total points
ID: 8083240
close does not close forms... it closes files..

use "Unload Me" instead or "Unload <form>"
0
 

Author Comment

by:kidgenius2002
ID: 8083273
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
 
LVL 10

Expert Comment

by:aeklund
ID: 8083295
<g>... (microsoft is the one laughing I guess)

glad to help
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question