I need the program I have made to do
a few things nomatter what before
it closes.
When I Press Ctrl+Break the program
pauses and then I press the stop
button and the program doesnt run
through that ending code.
How can I still run that code??
Printable View
I need the program I have made to do
a few things nomatter what before
it closes.
When I Press Ctrl+Break the program
pauses and then I press the stop
button and the program doesnt run
through that ending code.
How can I still run that code??
Have you look at On Error Goto
Say what? Not sure what you are referencing
If you are referring to the stop button in the VB pgm then nothing runs..that button says STOP..END
If you have created your stop button then put your code ahead of your unload.
Commnand Button_Click
Msgbox "Help, I've fallen and I can't get up."
unload me
set form1 = nothing
end sub
try pressing F8 when u are about ready to run your program. this will take u step by step through every line of code. this is a great way to debug any program.
another great way to debug programs is to use the "run to..." command. put your cursor where u want to start checking your code when it gets to that point of the program.
this will let u see exactly what lines are actually being executed and which ones are not. breakpoints will also help u. please inform me if this is of any help.
OK,
I know how to debug the stupid thing.
I want to run through a line of code
no matter what happened. If I press
the stop button the program WILL NOT
run through the terminate code.
I need it too~!
[Edited by Dayo312 on 06-11-2000 at 02:10 AM]
Try the QueryUnload event of the form. You can capture how the form was closed and take appropriate action from there
The stop button in vb functions the same as the End command.
Code execution is stopped immediate, and all objects are unloaded.
If you want the code in the QueryUnload and Unload events to be executed, don't use the End command, and don't press the stop button in the IDE.