+ Reply to Thread
Results 1 to 4 of 4

Improve Performance of Form with 80 Dlookups

  1. #1
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Improve Performance of Form with 80 Dlookups

    I was requested to improve a timesheet form that currently resides in Excel. The main goal is ease of use. I had the brilliant idea of moving it ot Access because then I could combine it with other forms that are used and make it a one-stop shop. I then had another brilliant idea of making a form with a calendar on it.

    The attached is the result, so far.

    The problem I am having is that in order to make the form appear as a calendar, I had to include 42 days (6 weeks with 7 days per week). Each day displays the day, the Hours Absent and the Reason Code for the absence. This gives me 146 controls in the calendar, 84 of which use DLookup.

    It is not unbearably slow, but it is noticeably slow, and some users may get frustrated.

    Is there any way I can avoid the Dlookups? Some magic SQL statement or VBA solution?

    ***Edit***
    Cross-posted here:
    http://www.accessforums.net/forms/im...ups-18149.html
    Attached Files Attached Files
    Last edited by Whizbang; 10-18-2011 at 05:11 PM.

  2. #2
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Re: Improve Performance of Form with 80 Dlookups

    Monday morning bump.

  3. #3
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Re: Improve Performance of Form with 80 Dlookups

    I tried the following sub to clear all 84 controls and then assign values from the query, but it is slower than the DLookup function.

    Please Login or Register  to view this content.
    Any ideas on how to improve the speed of the above sub? Anyone have experience displaying multiple records in Calendar format?

  4. #4
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Re: Improve Performance of Form with 80 Dlookups

    Solved it!
    A comment in the linked cross-post made me re-test the code above. Evidently what was slowing it down was this:

    Please Login or Register  to view this content.

    This was clearing the ControlSource for all 84 fields. This wasn't necessary. I only need clear the ones that actually have a string in the control source. So I modified it and it runs MUCH faster.


    The revised code is:

    Please Login or Register  to view this content.
    The attached database is the updated version.
    Attached Files Attached Files
    Last edited by Whizbang; 10-18-2011 at 05:25 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1