Results 1 to 6 of 6
  1. #1
    twgonder is offline Expert
    Windows 10 Access 2016
    Join Date
    Jun 2022
    Location
    Colombia
    Posts
    650

    Access shuts down with crash and loses report macros


    This has happened to me a couple of times now.
    I create a db for testing a new way of doing things.
    I copy over a few objects, make mods, test it works then...

    I try copying back the test forms, tables and VBA code while having two instances of Access open for easier copying.
    One of the open Access sessions goes nuts, looks like it's shutting down and goes to a Backup page.
    I backup, then reopen the db and the macros for the reports are missing! All the hard work gone!

    One time I mis-renamed a report to have a "-" and not a "_" in the name and that really caused problems after renaming again, it kept saying the report with the "-" name was missing.
    Another time I was in the module copying and it crashed.

    I can't see how to get the code back.
    But more importantly in the big picture, what am I doing wrong that makes Access freak out like this?

  2. #2
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    seen that. finicky db.
    It may not like the copy/paste method.
    try Importing everything. It may prevent crashing.

  3. #3
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    Could export instead

    Can happen if the instance is not compiled or worse left running and stopped at a breakpoint. You can also get a 'database in use' message

    And regards terminology when you say macros, do you mean macros or VBA? They are different things in Access but in the other office apps a macro is actually vba. Only reason for asking is you said ' try copying back the test forms, tables and VBA code ' and 'reopen the db and the macros for the reports are missing! '

  4. #4
    twgonder is offline Expert
    Windows 10 Access 2016
    Join Date
    Jun 2022
    Location
    Colombia
    Posts
    650
    Quote Originally Posted by CJ_London View Post
    Could export instead

    Can happen if the instance is not compiled or worse left running and stopped at a breakpoint. You can also get a 'database in use' message

    And regards terminology when you say macros, do you mean macros or VBA? They are different things in Access but in the other office apps a macro is actually vba. Only reason for asking is you said ' try copying back the test forms, tables and VBA code ' and 'reopen the db and the macros for the reports are missing! '
    The code may have stopped due to an error. Sometimes I'm not sure the status of running stuff. How do you know where running code stands?

    As to terminology, yep I agree, but even Microsoft is prone to calling VBA code snippets "macros". As have MVPs in training videos. And it confuses me to when they do that. I tried the lingo and it didn't work for you either.

  5. #5
    twgonder is offline Expert
    Windows 10 Access 2016
    Join Date
    Jun 2022
    Location
    Colombia
    Posts
    650
    I have gotten the 'database in use' at times and have gone, "huh?"

    I'll check out exporting, but I'll copy fields, records, tables, reports, VBA...all of those sometimes.

  6. #6
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    but even Microsoft is prone to calling VBA code snippets "macros".
    can't say I've noticed that in relation to Access - it is usually in the context of Excel. Either way you'll confuse the hell out of people here and other access forums if you refer to vba code as a macro since as already stated, in Access they are different things. Tables can have data macros - but then they should be referred to as data macros as again, they are different to 'ordinary' macros.

    How do you know where running code stands?
    I would define 'running' as taking up memory. An open form or report or an open query will be taking up memory even if not actually doing anything at the time - variables will be populated for example. The form/report itself without any code will take up some memory. This will still be the case if the code has stopped on an error. Compiling code and saving any open objects should resolve it but the only way to really ensure code has stopped is to close and reopen the database.

    I don't know the mechanics of it but copy/pasting is not the same as import or export. Biggest difference is copy/paste transfers whatever to the clipboard then pastes it to wherever. Import/export won't be using the clipboard.

    I copy over a few objects, make mods, test it works then...
    Making mods to code can result in collecting 'trash' hidden away in the module - broken up bits of code no longer used, variables renamed etc. Compiling and compacting does not remove this trash. This trash may also by copied to the clipboard then has no place to go when pasted.

    The only way to remove trash is to decompile. You'll be surprised how much room it can take up in an extensively modified app - I've seen apps reduce in size by 50% before now. To see the effect

    compact - note the file size
    decompile
    recompile - note the file size

    see this link for how to decompile http://fmsinc.com/MicrosoftAccess/Pe.../Decompile.asp

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

Similar Threads

  1. Replies: 3
    Last Post: 10-12-2021, 01:18 PM
  2. Microsoft Access Program shuts down
    By mp3909 in forum Access
    Replies: 6
    Last Post: 08-01-2019, 08:22 AM
  3. Replies: 4
    Last Post: 06-11-2016, 07:07 AM
  4. Replies: 3
    Last Post: 04-13-2016, 04:11 PM
  5. Queries & Macros aren't producing results after system crash
    By Nashskye13 in forum Database Design
    Replies: 2
    Last Post: 06-07-2012, 03:12 PM

Tags for this Thread

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