Results 1 to 5 of 5
  1. #1
    Beorn is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2011
    Posts
    4

    What actually happens at docmd.openform

    Greeting Access-board!

    Im relatively new to Access but have some background in VBA programming.

    Currently im dealing with a relatively large Database (Access File size currently at 1GB) wich of course makes computations very slow.

    Im now trying to speed things up a bit and was wondering what actually happens at the Docmd.openform command. I dont mean "The form is opened" but im wondering what happens in the background.
    The problem is that some of my forms take extremely long to execute this single line, so i think there is something else happening besides the simple "form opening" task.

    So if anybody knows how to deal with speed issues on docmd.openform or can explain what actually is checked/computed on this command, please answer!



    Thanks in advance for all responses and excuse my english, im not a native speaker.

    Beorn
    Last edited by Beorn; 01-05-2011 at 02:39 PM.

  2. #2
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    docmd.openform just open a form. what runs in background is not for this command, but what actually the form does. In other word, how long does it take to open a form is depend on the form.

    If a form takes long time to open, you need to find out what does the form do when it opens. Since you mentioned that you have a lot of data in the database, I assume the form's data source query takes long time to run(form shows data from data source when it opens).

  3. #3
    Beorn is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2011
    Posts
    4
    thanks for the reply!

    My problem is that this behaviour (query, etc.) is not obvious from the vba-code.
    In the code lines there are no tme consuming tasks done when the form is opened. The only thing done when the form is opend is writing some SQL commands for querys which are later on executed.

    SO can there be querys associated to the form in a way that they execute whenever the form is opened? Or what else can be time consuming which is not visible in the vba code?

    Regards
    beorn

  4. #4
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    does it happen with other forms as well?

    if you're on a network with a file that size, the first that's going to cause anything for you is the bandwidth. if you're on a network, have you tried using the same thing on and off of that network?

    and you say that some sort of sql commands execute when the form is opened. if anything that takes as long as an sql command is being executed on the load event of the form, then the long load time is probably normal.

  5. #5
    Beorn is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2011
    Posts
    4
    thanks for the reply!

    Im working completely offline on this, so no bandwidth, connection-problems or anything related involved.

    Again, im comming from the vba-side with almost no experiance in sql and non-vba related access stuff.

    What i did now:
    I commented everything in the "Private Sub Form_Open", so there should be nothing computed when thr form is opened.
    In VBA-break mode im following the execution of the code and from the docmd.formopen until the next line of code there are 15sec of waiting.

    During this time the status bar of access reads "Running query".

    So there seems to be some execution of querys. So there must be a way to execute uerys without the use of vba?
    How can this be?
    Again this can be something extremely trivial, i just not know jet so please dont hesitate to throw any wild thoughts in here you have.

    thanks in advance

    Beorn

    Edit:
    Stupid "error" found: You can ad a "RecordSource" through the Property sheet or each Form which will execute a query without any vba code.
    Access is weird. Too many things can be done in too many different ways...
    Anyways, thanks guys for the help. It was much appreciated!
    Topic solved
    Beorn

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

Similar Threads

  1. Getting to a tab on openform
    By Swarland in forum Programming
    Replies: 5
    Last Post: 12-12-2010, 11:22 AM
  2. OpenForm in subform not working
    By eyuen in forum Forms
    Replies: 3
    Last Post: 11-10-2010, 12:03 PM
  3. OpenForm macro
    By tguckien in forum Forms
    Replies: 3
    Last Post: 07-06-2010, 09:12 AM
  4. Passing Data with OpenForm
    By nkenney in forum Forms
    Replies: 1
    Last Post: 10-26-2009, 11:40 AM
  5. DoCmd.OpenForm Modification
    By alsoto in forum Forms
    Replies: 6
    Last Post: 05-01-2009, 07:28 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