datAdrenaline
AWF VIP
- Local time
- Today, 15:43
- Joined
- Jun 23, 2008
- Messages
- 697
Hello Doc ...
>> And the truth is, REAL programmers use assembly language <<
No shields needed from me on that!!! ... But can we modify that to "REAL programmers have used assembly language"!!! ...
...
>> The only reason I am not so sanquine about using functions in place of event procedures is precisely because you are creating "hidden" side effects by doing so. With an explicit event procedure, people EXPECT to look in the code to see what it is doing to other things. With a function call, that expectation is less obvious and could lead to confusion <<
I, with the utmost respect, disagree. If you have defined your click event to call a function with something like this:
=fFilterByLetter()
You can click on the elipses button to the right of the text box and when you do, you jump to the VBA code for that Function, which is really no different than having the property as "[Event Procedure]", and clicking on the elipses and being taken to the procedure.
After all a Function is just a procedure that returns a value, that value does not HAVE to be useful. So to me, I would see the function call in the property and just examine what that procedure does.
>> Macro to run some nightly thing on a scheduler and the Macro ends with a QUIT step. Try to do that any other way that doesn't involve leaving the database open on somebody's terminal at night <<
- An AutoExec macro can launch code that ends in DoCmd.Quit
- You can use a Startup form that has a Form_Load event that has code that ends in DoCmd.Quit
- All both a StartUp form and AutoExec macros can branch to appropriate code based on the command like switch of /command, VBA can then use the Command() function to return the text specified in the command switch and thus perform different steps in VBA ... all ending is DoCmd.Quit.
Please note that this is in NO WAY removing the significance of the /x command line switch and the macro action of Quit as they are very useful features ... I personally just don't like Macros, but the argument you make for their use is quite valid.
Also ... macros are gaining in power, as evidenced by there improved power in A2007. I would be surprized if that trend did not continue into the next version of Access. With all the desktop db's out there claiming to have great power with "no code" (for some reason they don't veiw macros/scripts/predefined steps ... as code), the Access development team has really no choice but to bring that type of power to the "Information Workers" across the globe.
.....
So ... along with the subjective "best tool for the job", we have the subjective "best practices", as well as, the tool that we like the best .... I've used my big cresent wrench more than once as an effective hammer!!!!
{disclaimer: with things like "best practices" and "best tool", I do realize that there is the curve where "most worth their salt" consider something a good or bad practice ... so I get that ... }
>> And the truth is, REAL programmers use assembly language <<
No shields needed from me on that!!! ... But can we modify that to "REAL programmers have used assembly language"!!! ...

>> The only reason I am not so sanquine about using functions in place of event procedures is precisely because you are creating "hidden" side effects by doing so. With an explicit event procedure, people EXPECT to look in the code to see what it is doing to other things. With a function call, that expectation is less obvious and could lead to confusion <<
I, with the utmost respect, disagree. If you have defined your click event to call a function with something like this:
=fFilterByLetter()
You can click on the elipses button to the right of the text box and when you do, you jump to the VBA code for that Function, which is really no different than having the property as "[Event Procedure]", and clicking on the elipses and being taken to the procedure.
After all a Function is just a procedure that returns a value, that value does not HAVE to be useful. So to me, I would see the function call in the property and just examine what that procedure does.
>> Macro to run some nightly thing on a scheduler and the Macro ends with a QUIT step. Try to do that any other way that doesn't involve leaving the database open on somebody's terminal at night <<
- An AutoExec macro can launch code that ends in DoCmd.Quit
- You can use a Startup form that has a Form_Load event that has code that ends in DoCmd.Quit
- All both a StartUp form and AutoExec macros can branch to appropriate code based on the command like switch of /command, VBA can then use the Command() function to return the text specified in the command switch and thus perform different steps in VBA ... all ending is DoCmd.Quit.
Please note that this is in NO WAY removing the significance of the /x command line switch and the macro action of Quit as they are very useful features ... I personally just don't like Macros, but the argument you make for their use is quite valid.
Also ... macros are gaining in power, as evidenced by there improved power in A2007. I would be surprized if that trend did not continue into the next version of Access. With all the desktop db's out there claiming to have great power with "no code" (for some reason they don't veiw macros/scripts/predefined steps ... as code), the Access development team has really no choice but to bring that type of power to the "Information Workers" across the globe.
.....
So ... along with the subjective "best tool for the job", we have the subjective "best practices", as well as, the tool that we like the best .... I've used my big cresent wrench more than once as an effective hammer!!!!
{disclaimer: with things like "best practices" and "best tool", I do realize that there is the curve where "most worth their salt" consider something a good or bad practice ... so I get that ... }