Ok, I think I get the Private and Public thing.
Still some questions on Sub and Functions. Understand the functions. There is some confusion on the Sub because I've searched and read forums on the subject. Summary of what I found: There are people using subs when it should be a function. Some say it's ok to do that, but others don't. If a sub doesn't return a value like a function, then how can they be using a sub instead to do what a function does?
God, I must sound like an idiot. They said that the VBA for Access and ArcMap is the same. It's not and I have to reprogram my brain to do things differently.
Below is a list with my guesses. Can you tell me if I'm correct?
Before I start the list - is this correct: If it is a Sub or Function that will be called on many times either in a single module or multiple modules, it should be stored in a public module. (or stored in ThisDocument at Project level?) How do you know when to use a module or ThisDocument (which is a module)?
1) Conditional text that will be called on to change a property(s) or variable number: Sub?
2) Complex math calculation the using VBA Functions and will be called on by an Event: Function?
3) Code used to sort data for a report in an unusual way (selected from option button): Sub?
4) If..Then Else and Case. Sub?
(Something I did in Access) For a report, If I need to get a variable value (1stValue) of a field on frmOne and use it to, conditionally, calculate a variable value (2ndValue) on frmTwo - and update update every time 1stValue changes. 1) 1stValue would be declared public in General Declarations 2) 1stValue would be referenced frmOne.1stvalue. 3) The whole this, 2 procedures? Both sub or function or mix of sub and function. (Or is my brain to stuck on how Access works and not GIS? (In Access this was used on a Form and subform situation where data stored in table and attached to a Print Report CmdButton)
What if you have a set of procedures that all run on an Event? Would you put it in a Public Module and call on the Module instead of the (subs & functions) Ex. a specialized Buffering method that a company want's all employees to use and you would put it on the Toolbar (IUEditBoxControl). Would be saved in ThisDocument under Normal (Global)
I've just been asked today if I could do this:
On an ArcMap template, use an inputbox to get the Title (a Project name) and then put it in the Title text box followed by also putting the Title into the disclaimer text box, i.e., strDisclaimer = "1st part of disclaimer text " & strTitle & "rest of disclaimer text." (One procedure? Sub or Function? And then make the Title Editable (and update in the disclaimer). The edit wouldn't be a new procedure - just run the 1st one again. I'm assuming that this would be on the click event of the Title text box (that's how it was done in Access). Then attach a msgBox to the disclaimer box that says, "The disclaimer text can only be changed by the Administrator" and have the OK button. Is there a module for the templates display? Haven't even finished the course an I'm already being asked to program.
Thanks for your patience.