Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calling sub from sub problem

Status
Not open for further replies.

hinchdog

Programmer
Feb 14, 2001
380
0
0
US
Hi, i'm having a problem when i call a sub from within another sub. The first sub is on a form, and the sub it calls is in a module. The called sub is being called ok, but it is not returning to the original sub to finish executing. What the heck is going on here? thx, frank

Private Sub1(var,var)
...
...
Call Sub2(var,var) -- this is in the module
.. << This code does not execute!
... <<
End Sub

 

Hi
There must be something in Sub2 that messes up the calls. Do your use goto?
Try debugging your way through to see what happens.

Sunaj
 
I'm not familar with the Goto debug method. I'm still kinda new. Could you explain this for me. Thanks!

-Frank
 
Hi:

Do you have any error handling going on? If you have error handling, it is possible that the sub in the module is erroring out, thereby causing the code to drop to the error handler in the first form. If not,
Try changing the sub to a function which returns a value telling you whether or not the function was successfull.

Joe Logan Joseph Logan
jlogan@softsource.net
 
Ahh, yes I did have error handling and it still wasn't working. The changin to a function thing is intesting though. Good idea. It actually just started to work though. I have no idea why. Thanks for your helpful suggestions though. :)

-Frank
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top