Converting Macros to VBA Do command or execute

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RockKandee
    New Member
    • Dec 2013
    • 89

    Converting Macros to VBA Do command or execute

    Hi All,

    I am using Access 2013 with Windows 8.

    I am in the process of converting all of my macros into VBA. I read somewhere that it is better to use ? rather than do com. I cannot find it now to read it again.

    I think it was execute....

    I would love to get some input before I have too much code to fix - lol

    So opinions on what code is best to use rather than, for example

    Code:
    DoCmd.SetWarnings False
            DoCmd.OpenForm "DropAdventureMain", , , , , acDialog
            
            DoCmd.SetWarnings True
    Thanks :)
  • zmbd
    Recognized Expert Moderator Expert
    • Mar 2012
    • 5501

    #2
    Each has merit so I leave it up to you to decide; however, you might want to read these two bytes threads:




    And then the following will cover some other aspects:
    Executing SQL Statements in VBA Code

    So when to use each depends alot on what and how you code.

    The built in Macro to VBA conversion wizard will tend to use the docmd.runsql more often than not so such code may not always be optimal; however, it is still quite functional and (IMHO) only need be tweaked if there are performance issues.
    (^_^)
    -z

    Comment

    • RockKandee
      New Member
      • Dec 2013
      • 89

      #3
      Thank you!

      Great info links and all in one handy location for me to find again :)

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32633

        #4
        The author of the last one seems to know his stuff. I like what I read.

        Comment

        Working...