Notices

Great community. Great ideas.

Welcome to ASP/Free, a community dedicated to helping beginners and professionals alike in improving their knowledge of Microsoft's development and administration technologies. Sign up today to gain access to the combined insight of tens of thousands of members.

Thread: Difference between Macro code and VBA?

Results 1 to 7 of 7
Share This Thread →
  1. #1
    danny2000 is offline Registered User
    Join Date
    Mar 2009
    Posts
    24
    Rep Power
    0

    Difference between Macro code and VBA?

    Hi

    I'm very hazy as to whether there is a difference between macro code and vba. Surely if you use an event handling procedure such as clicking a command button it could triger normal vba code in that procedure. Does Access record something different when you just use the wizard (in terms of the code) or is there no difference?

    Every book just jumps right in without explaining this.

    Any help on this would be greatly appreciated. Thanks.

    danny2000

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Contributing User
    Join Date
    Oct 2005
    Location
    @ 8300' in the Colorado Rocky Mountains
    Posts
    1,008
    Rep Power
    162
    Not real sure about your question but the big differences are that code if far more flexible and extensible and allows for error handling.

  3. #3
    danny2000 is offline Registered User
    Join Date
    Mar 2009
    Posts
    24
    Rep Power
    0
    Quote Originally Posted by RuralGuy
    Not real sure about your question but the big differences are that code if far more flexible and extensible and allows for error handling.
    Thanks. I just don't understand when I'm 1 - creating a macro and what does that macro code look like. Does it use the same syntax as VBA? If it does, why would there be an option to convert it to VBA?

    2 - Can you confirm that a macro is created when you access the properties of a control in design view.

    Thanks
    danny2000

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Contributing User
    Join Date
    Oct 2005
    Location
    @ 8300' in the Colorado Rocky Mountains
    Posts
    1,008
    Rep Power
    162
    Quote Originally Posted by danny2000
    2 - Can you confirm that a macro is created when you access the properties of a control in design view.
    Only when that is what you want it to do.

  5. #5
    don94403's Avatar
    don94403 is offline Contributing User
    Join Date
    Jan 2007
    Location
    Northern California
    Posts
    3,536
    Rep Power
    763
    Quote Originally Posted by danny2000
    when I'm creating a macro and what does that macro code look like. Does it use the same syntax as VBA? If it does, why would there be an option to convert it to VBA?
    No, macros and VBA are totally independent of each other and share almost no syntax.

    VBA is a programming language, derived from Visual Basic. Macros are technically not programming, they are a simplified way to string together sequential commands.

    Many of the same operations can be done either by using a macro or writing a VBA procedure, so it's usually possible to convert a macro into an equivalent VBA procedure, but the reverse is generally not possible, since a fully featured programming language can do a lot that macros cannot.

    Can you confirm that a macro is created when you access the properties of a control in design view.
    I don't really understand your question. Certainly the direct answer is No.
    Experience is the thing you have left when everything else is gone.

  6. #6
    danny2000 is offline Registered User
    Join Date
    Mar 2009
    Posts
    24
    Rep Power
    0

    Wink Macro's and VBA

    Thanks everyone. I think I understand now.
    When I look at a macro created when I access the properties of a control and look at the code created by that macro it looks similar to VBA.

    I was really just trying to understand what we are converting it to when we use the Convert to VBA function in access. At a glance the code looked similar if not almost the same.

    Thanks again for coming back.

    danny2000

  7. #7
    don94403's Avatar
    don94403 is offline Contributing User
    Join Date
    Jan 2007
    Location
    Northern California
    Posts
    3,536
    Rep Power
    763
    Quote Originally Posted by danny2000
    Thanks everyone. I think I understand now.
    When I look at a macro created when I access the properties of a control and look at the code created by that macro it looks similar to VBA.

    I was really just trying to understand what we are converting it to when we use the Convert to VBA function in access. At a glance the code looked similar if not almost the same.

    Thanks again for coming back.

    danny2000
    Oh, I think I now see what you are referring to. Those are not and never were macros. That is 100% VBA, perhaps created by a wizard, but not a macro, which is something entirely different. Macros are created by opening the Macros tab in the Database Window and entering macro commands on successive lines. This has no relation to VBA and event procedures.

Share This Thread →

Become Part of This Conversation

Join NowFor Free!

ASP Free Advertisers and Affiliates