Macro vs VBA?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm starting to learn and use VBA & SQL. I've read that one of the
advantages to using SQL directly in the record source of a report is that end
users can't easily change the query (since there won't be one in the Query
object list). To get used to using VBA, I'm using DoCmd in VBA to replace
the macros I used to use. Can someone tell me if there is an advantage (or
disadvantage) to using Macros or VBA or attach a link to some documentation
that will help me? I appreciate it -
 
Alex said:
I'm starting to learn and use VBA & SQL. I've read that one of the
advantages to using SQL directly in the record source of a report is
that end users can't easily change the query (since there won't be
one in the Query object list). To get used to using VBA, I'm using
DoCmd in VBA to replace the macros I used to use. Can someone tell
me if there is an advantage (or disadvantage) to using Macros or VBA
or attach a link to some documentation that will help me? I
appreciate it -

The advantages of VBA over Macros are too numerous to mention, but probably
one of the biggest is that Macros have no error handling.

The advantages of Macros over VBA are listed below...

Easier to learn (if you don't know either)
AutoKeys (I've never used it, but I understand there is no code equivalent)
 
VBA can do ALMOST everything a macro can do, I never use them myself, much
prefer to write code to do tasks rather than macros, I think the error
checking within code blocks is a stronger option as well. I think some of
the things you cannot do easily within VBA are things like autokeys and
things like that. There was a post a couple of days ago that contained
several things macros could do that code could not. But VBA can do a lot of
things that the macros cannot, so in my view VBA is the way forward unless
you have to use a macro.
 
Back
Top