Auto Exec macro hangs after compact/repair

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Fiddler2
    New Member
    • Mar 2008
    • 19

    Auto Exec macro hangs after compact/repair

    I noticed that after running compact/repair, I have to recompile my code for the program not to break the next time I open it. What happens is the auto exec macro runs the main() module, then hangs with the second line of code highlighted. No error message, just hangs. If I stop it and recompile the code, it runs again. Does anyone know anything about this? Is there some way to run something to recompile the code automatically after compacting so it doesn't get a hang the next time? Following is the code that runs after the autoexec macro (which simply calls the code):

    Public Function Main()

    Call SetStartupPrope rties
    DoCmd.OpenForm "frmSplash" , acNormal, , , , acWindowNormal
    DoCmd.OpenForm "frmLoginMa in", acNormal, , , , acDialog

    End Function
  • PianoMan64
    Recognized Expert Contributor
    • Jan 2008
    • 374

    #2
    By change to do you have something defined in the Startup options in the database under Tools -> Startup?

    If so, that needs to be changed to a blank.

    The reason that may be doing that is if you're trying to open the form more than once, or two forms or two operations going on at the same time...

    If that doesn't solve it, let me know.

    Joe P.

    Comment

    • Fiddler2
      New Member
      • Mar 2008
      • 19

      #3
      Originally posted by PianoMan64
      By change to do you have something defined in the Startup options in the database under Tools -> Startup?

      If so, that needs to be changed to a blank.

      The reason that may be doing that is if you're trying to open the form more than once, or two forms or two operations going on at the same time...

      If that doesn't solve it, let me know.

      Joe P.
      Thanks for the quick response. I didn't even look under the startup properties as I'm setting up the db properties for the session using code rather than manually. I've used this same code numerous times with other databases and never had a problem, but this is the first time I've used version 2003, so I wonder if it has to do with that? I'm too tired to look this up tonight (or this morning), but thanks for the tip. I'll check it out.

      Comment

      • Fiddler2
        New Member
        • Mar 2008
        • 19

        #4
        Originally posted by PianoMan64
        By change to do you have something defined in the Startup options in the database under Tools -> Startup?

        If so, that needs to be changed to a blank.

        The reason that may be doing that is if you're trying to open the form more than once, or two forms or two operations going on at the same time...

        If that doesn't solve it, let me know.

        Joe P.
        Hi Joe,

        I didn't have anything set under startup except for an icon. Would that be enough to cause this? Today when I opened, it halted during the load event of the second form. No explanation, no error. I keyed F5 and it just continued like it should have done to start with.

        Ideas?

        Thanks

        Comment

        Working...