I'm a newbie (though I've created a couple simple apps for my company) and I'm having trouble understanding why one would use "Private" for a sub or anything else. Can somebody help me out?
Printable View
I'm a newbie (though I've created a couple simple apps for my company) and I'm having trouble understanding why one would use "Private" for a sub or anything else. Can somebody help me out?
:confused:
Private sub or private variable?
I was referring to a procedure, but I'd also like to know why you'd use private variables.
Private variable
[code]
Dim intx as integer
Say you are doing a for loop:
[code]
For intx=1 to 100
[code/]
If it was public it would retain the value. In this case, why would you need to know the value (it will be 100 when finished).
As far as procedures go, Private procedures can only be called within their form. If a procedure is Public, you can call it from any form in the whole project.