Results 1 to 2 of 2
  1. #1
    fishhead is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2015
    Posts
    167

    Converted macros to vb

    I've read that i may be able to speed up performance by converting my macros into VB.

    I've just done this and now have a macro "M1RP" that has been converted to show "CONVERTED AMCRO-M1RP"



    my question is how do i link this VB macro to my command button.
    currently the ON CLICK property is set to m1rp.openrp
    i don't see any obvious way to link this to the "Converted Macro-M1RP"

    note m1rp has submacros within it

    Can anyone please assist?

    thanks
    Steve

  2. #2
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    What I typically do is this following:
    1. Open the Properties of the Command Button
    2. In the "On Events" tab, on the "On Click" line, click on the button with the three dots, and select "Code Builder".
    This will give you the shell of your code like this:
    Code:
    Private Sub Command1_Click()
    
    End Sub
    3. Copy the "guts" of your converted macro (everything between the "Function..." and "End Function" lines, and paste it in between the two lines of code above.

    Now whenever you click that button, it will run the code.
    For cleanup purposes, you can delete the original Converted Macro code after doing this.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Editing a converted menubar add-in
    By ngrover in forum Access
    Replies: 0
    Last Post: 06-01-2017, 03:52 AM
  2. Auto run converted Macro
    By steven7 in forum Macros
    Replies: 3
    Last Post: 06-09-2016, 11:26 AM
  3. Using macro converted to VBA in other functions
    By gaker10 in forum Programming
    Replies: 4
    Last Post: 08-19-2014, 07:44 AM
  4. Converted macro to VBA not working
    By gemadan96 in forum Forms
    Replies: 5
    Last Post: 06-04-2014, 10:36 AM
  5. converted coding issues.
    By d4jones in forum Database Design
    Replies: 2
    Last Post: 07-11-2012, 09:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums