Results 1 to 3 of 3
  1. #1
    justinr12345 is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2018
    Posts
    7

    DoCmd.OpenForm takes a long time to load the Form_Load Event (Access 2016)

    I have a Menu Form. When the User selects the button 'Main' it opens the form 'MAIN' as seen in the code below
    Code:
    Private Sub Command0_Click()
    
    DoCmd.OpenForm "MAIN"
    
    End Sub
    The form should ideally leave the DoCmd statement and hit the MAIN Form__Load event immediately. The issue is it takes a few seconds for the code to reach the beginning of MAIN_Load and I am unsure why. Inbetween this time the bottom of Access says 'Calculating . . .' and 'Running Query', although there is no code that requires a query to run when this is called. The RecordSource of MAIN is "SELECT * FROM APN_Status" which is just a table, no query involved. Does it just take a while cause my form is complicated (navigation control with multiple pages, some with navigation controls themselves.)

    How can I figure out what is happening between this event??

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    Almost certainly the issue is that your form is complex.
    As a test, rename it temporarily as something else.
    Now create a new continuous form based on that table but without navigation control or multiple pages.
    Does it open quickly?
    If yes, then you need to review the design of your real main form and try to reduce the number of things that need to be loaded at the start
    However if the simplified version loads slowly then something else is the issue - probably the menu form - possibly corruption

    One other thing worth trying is decompiling - see http://www.fmsinc.com/microsoftacces.../decompile.asp
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Quote Originally Posted by justinr12345 View Post
    [COLOR=#242729][FONT=Arial]

    ...Access says. . .'Running Query', although there is no code that requires a query to run when this is called. The RecordSource of MAIN is "SELECT * FROM APN_Status" which is just a table, no query involved. ...
    I agree that the probable culprit, here, is the Form being so complicated...but note that the RecordSource

    "SELECT * FROM APN_Status"

    is a SQL statement, and does, in fact, create a Query, from the standpoint of the Access Gnomes...hence the message.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

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

Similar Threads

  1. Replies: 2
    Last Post: 09-05-2014, 01:23 PM
  2. Count query takes too long time
    By shabar in forum Queries
    Replies: 4
    Last Post: 01-28-2013, 09:00 PM
  3. Replies: 10
    Last Post: 04-17-2012, 10:29 AM
  4. Replies: 3
    Last Post: 12-23-2010, 10:23 AM
  5. Query Design View Takes a Long Time to Open
    By jackthedog in forum Queries
    Replies: 0
    Last Post: 12-22-2009, 03:27 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