willunited Posted February 19, 2013 Author Share Posted February 19, 2013 What's the diference of Public Sub and Private Sub? Link to comment Share on other sites More sharing options...
JohnPony Posted February 19, 2013 Share Posted February 19, 2013 A private sub is only accessible from within the module that it's declared in.A public sub is accessible anywhere throughout your solution.Regards,GP Link to comment Share on other sites More sharing options...
boyesjs03 Posted February 19, 2013 Share Posted February 19, 2013 www.touchofdeathforums.com/community/index.php?/page/index.html/wiki.html/_/visual-basic-6/getting-started-r10 Link to comment Share on other sites More sharing options...
Lavos Posted February 19, 2013 Share Posted February 19, 2013 To keep it brief a Private sub can only be called within the scope of a form or module.A Public Sub can be called anywhere in any scope through the entire Project.This goes the same with functions and declaring variables.So if you want to pass a value through a different scope module, Use the public routine. Link to comment Share on other sites More sharing options...
abhi2011 Posted February 19, 2013 Share Posted February 19, 2013 There are 2 scopes for sub, vars etc. Public and Private.In a sub declared as public, it can be called from wherever you are within the application.In a sub declared as private, it can be called only from the module it is residing in. Link to comment Share on other sites More sharing options...
WiseRock Posted March 10, 2013 Share Posted March 10, 2013 here[http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/cb4474e4-f815-4689-b10e-22f01c4ce512/](http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/cb4474e4-f815-4689-b10e-22f01c4ce512/) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now