Drew Wutka
DWUTKA at marlow.com
Wed Apr 23 18:59:28 CDT 2003
Yes, a macro can be run from an event. However, the user can flat out run it on it's own. They cannot do that with a VBA function/sub. There has to be an event that calls the function or sub (or an event has to occur to fire the code within an event). They could use the immediate window to fire code, but the immediate window is part of the VBE, and not something the average user knows about. Along those lines, macros cannot require arguments. Yes, macros can have condition statements, and they can look for values, but when you run a macro, it's run, you don't have to 'give' it particular values to run it. (Thus the 'Run' button). VBA procedure CAN require arguments, which must be supplied (unless they are optional) in order to run. Drew -----Original Message----- From: Stuart McLachlan [mailto:stuart at lexacorp.com.pg] Sent: Wednesday, April 23, 2003 6:27 PM To: Susan Harkins; accessd at databaseadvisors.com Subject: Re: [AccessD] VBA question But then again, I'm sure most of us have seen applications developed by newcomers to Access where every relevant event has a macro attached to it and there isn't a single line of hand written code. I had to maintain one of these a couple of years ago. Some ot the macros had 30 - 40 lines in them, mainly doing "SetValue" on a big hidden form, running delete & append queries using the hiden forms field as parameters and opening wizard-built reports. :-( Aren't those macros executed programatically? The user doesn't know they exist. On 23 Apr 2003 at 15:43, Susan Harkins wrote: > Drew, I was thinking along similar lines this morning, but came up > with -- a macro is something the user executes on purpose, whereas VBA > procedures are executed programmatically -- either through event or > some other procedure call. How's that? > -- Lexacorp Ltd http://www.lexacorp.com.pg Information Technology Consultancy, Software Development,System Support. _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com