Did I miss something ??

Here is something that does not make sence to me at this moment.  On a form I have a button and all I want it to do is end the program.  I put in the code that I thought would work and it fails with an error "Method or data member not found" and then is highlighted on the button Click.  Code follows:

Private Sub CloseProgram_Click()

    DickensenPrint.Close
   
End Sub

From what I can see this is about as simple as can be.  But why wont it work.  From what I can remember from versions 4 and 5 all I had to do was put in me.close in a command button click event and the program would end.  But this one fails.  I am confused as to why?  BTW this is done in VB6.0 Pro.

TIA

Craig
csindorfAsked:
Who is Participating?
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
I suppose that your form is called DickensenPrint
Your statement will read
Unload DickensenPrint
or if the button is on the form itself
Unload me
0
 
tkuppinenCommented:
Try the unload statement.

In your case it would be

Private Sub CloseProgram_Click()
   
     unload me
     
End Sub

0
 
csindorfAuthor Commented:
TKS
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.