Results 1 to 4 of 4
  1. #1
    klnlsu is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Apr 2015
    Posts
    107

    Problems with Macros in Access 2013?

    I have a textbox on a form in an Access 2013 database. The OnClick event in this textbox closes another form that is normally open. In case the form is already closed, I have put simple error check code in the OnClick event of this textbox as follows:

    On Error Resume Next


    DoCmd.Close acForm, "frmLast3ItemTransactions", acSaveNo
    On Error GoTo 0

    I realize this is sort of sloppy, but it works (until...)

    When I add a button to this form that runs a macro when clicked, I get the generic "Access has detected a problem and will close" error when I click my textbox. When I replace the macro in the button with VBA code, I no longer get the error when I click the textbox. I have macros in other databases that seem to work just fine.

    I have heard that Access 2013 has had some issues with macros, but I have heard nothing specific. Can someone expand on this? Should I just avoid macros altogether? Have these issues been resolved in Access 2016? Any enlightenment will be appreciated.

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,409
    I haven't heard anything about problems with macros, but personally I avoid them because a) they have limited functionality when you get into it a bit deeper and b) debugging is very difficult.

  3. #3
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    2010 had those problems with embedded macros, especially orphans (deleting the OnX event but the macro itself doesn't get removed and remains in the database). Definitely avoid the use of macros - but make sure to remove them cleanly.

  4. #4
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,404
    When I replace the macro in the button with VBA code, I no longer get the error when I click the textbox.
    That's the perfect solution.

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

Similar Threads

  1. Replies: 1
    Last Post: 09-01-2015, 02:01 PM
  2. Replies: 2
    Last Post: 08-13-2015, 02:14 PM
  3. Replies: 6
    Last Post: 06-05-2015, 03:08 AM
  4. Converting Macros To VBA in 2013 Office
    By data808 in forum Access
    Replies: 8
    Last Post: 06-17-2014, 02:37 AM
  5. Problems with macros
    By Malcolm in forum Access
    Replies: 13
    Last Post: 04-12-2012, 07:42 PM

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