Results 1 to 7 of 7
  1. #1
    angel93102 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2015
    Posts
    2

    Automate VBA Code

    I want the control wizard to create VBA code, not embedded macros. I checked


    the "Always use event procedures" box in the Access Options - Object
    Designers, but the wizard still creates embedded macros instead of VBA code.
    What I am missing?

  2. #2
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    An event is something a user does, the procedure is what the program does based on the event. A macro is a procedure.

    That's my understanding anyway.

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    Macros are easier for users to edit that dont know VB. They both work.

    If you want to use VB, click the elipsis button at the event property, then click CODE BUILDER

  4. #4
    JamesDeckert is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2015
    Location
    Salina, KS
    Posts
    262
    That checkbox affects the codebuilder to automatically choose VBA. The wizard builds macros.
    Here's a site that shows how to convert a macro to VBA
    http://rogersaccessblog.blogspot.com...-vba-code.html

  5. #5
    angel93102 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2015
    Posts
    2
    That's exactly what I thought, but, it doesn't take effect.
    I really need that feature for smooth work.
    By the way, the conversion doesn't work. I've tried several times always got the same error:
    "There was a problem opening the [Embedded Macro]. Do you want to continue?"

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Perhaps you could post a copy of your database so readers could see the issue based on their "access" parameters.

  7. #7
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by angel93102 View Post
    ...By the way, the conversion doesn't work....
    You have to completely delete any embedded macros from controls. One way may be to erase all of the text [Embedded Macro] within all events before adding any VBA. Another approach would be to delete the control and rebuild it. So it is likely you will need to copy and save any VBA generated by Access. Long story short, controls can be fickle and become corrupt.

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

Similar Threads

  1. Macro code: Automate Select Query Sequence
    By Ace2014 in forum Modules
    Replies: 2
    Last Post: 06-13-2014, 09:21 AM
  2. Replies: 12
    Last Post: 06-12-2014, 07:37 AM
  3. Need Code to Automate ImportExportSpreadsheets
    By Ace2014 in forum Programming
    Replies: 65
    Last Post: 06-12-2014, 06:43 AM
  4. Replies: 11
    Last Post: 12-11-2013, 10:35 AM
  5. Replies: 1
    Last Post: 09-06-2006, 11: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