Solved

Slow Form

Posted on 2004-04-22
13
293 Views
Last Modified: 2011-03-07
I have a main form. On this for I have a Tab Control, with three tabs.

On each of the tab there is a sub form. All was working well until I put the last one on, it then seemed to slow the whole form down...

The form in question calculates the current usage and cost from a linked table, This table is about 80,000 lines long.

Is there anything that I can do to speed up this process? The wait is about 5 - 10 seconds

Any help welcome...

Thanks
Nev
0
Comment
Question by:NevHolland
  • 6
  • 4
  • 2
  • +1
13 Comments
 
LVL 65

Expert Comment

by:rockiroads
ID: 10887334
have you got the indexes set up on the tables/fields that u are using?
0
 
LVL 39

Expert Comment

by:stevbe
ID: 10887355
" linked table, This table is about 80,000 lines long."

If you are you loading the entire table ... 80,000 records is going to take a while. Is the underlying query only pulling the fields that are necessary for the form? Are you manipulating the data from this form? If not use a "snapshot", "read only" query.

Do you perform the calculation on all records when you load the form or only as needed in the current event?

Steve
0
 
LVL 2

Author Comment

by:NevHolland
ID: 10887417
The idea is to have the user add parts to a table.

These parts then go through a query that finds the usage and cost etc... This is the data that is then displayed on the form.
0
 
LVL 2

Author Comment

by:NevHolland
ID: 10887423
I've indexed all tables, only one missing....

Still takes 6 seconds
0
 
LVL 39

Expert Comment

by:stevbe
ID: 10887460
so subform 1 is where they add parts and subform 3 shows usage and cost?
how are you doing the calculations for usage and cost ... are you figuring it our for whatever part thay are currently looking at or do you calculate it for all records in a query and display the query?
0
 
LVL 2

Author Comment

by:NevHolland
ID: 10887524

PartDetail - Table
PartMaster - Link Table (80,000 Lines)
QryPartMaster - Query (grouping on partmaster to give total usage and cost)
QryPartDetail - Query using PartDetail and QryPartMaster to calculate total savings etc...

The subform is of QryPartDetail (user cannot edit detail)
To add / Edit the user opens a form that displays the parts for the project. When closing it requeries the subform...

I'm I explaining myself?
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 2

Author Comment

by:NevHolland
ID: 10887536
I need to run... I'll pick you comments up tomorrow...

Thanks for your help

Nev
0
 
LVL 39

Accepted Solution

by:
stevbe earned 100 total points
ID: 10891224
QryPartMaster set the query itself to be snapshot no locks, it will do this anyway but it does not hurt to set these properties.

I think you might get better response if you do not bind the QryPartMaster and QryPartDetail to the subforms as it needs to recalculate the query for the entire table each time you requery the subform. I would suggest looking at only displaying the records in the subform for the Parent record on the main form, you could pass the record ID field as a parameter to the query and then requery the subform in the current and after_update events.

Steve
0
 
LVL 2

Author Comment

by:NevHolland
ID: 10897054
Ok did as you suggested however the improvements are only small.

Each project has four states.. Two of these will require these calculations. So...

I have set-up that if one of these two states is selected then the page of the tab control becomes visible. I have also reset the RecordSource to ""

What I want to do now is reset the RS everytime the page is clicked however, I cannot find the command string that works

I'm using

Forms!frmProjectMaster![frmActualPartSavings].Form.RecordSource = "qryProjectDetailPart"
0
 
LVL 65

Assisted Solution

by:rockiroads
rockiroads earned 50 total points
ID: 10897933
to call subform form mainform do this

Me.<name of subform>.Form.Recordsource = "qryProjectDetailPart"
0
 
LVL 2

Author Comment

by:NevHolland
ID: 10898219
OK I'm getting there....

The only thing that I'm finding difficult to get the recordesouce to load when I press the page button...

At the moment it loads when a combo (on the main form) meets a certain value.

Any Ideas (points increased)

Thanks
Nev
0
 
LVL 39

Expert Comment

by:stevbe
ID: 10901587
use the change event of the tab control itself and the .Value property of the tab control tells you which page was selected ...


Private Sub TabCtl0_Change()
    Select Case Me.TabCtl0.Value
        Case 0
            MsgBox Me.TabCtl0.Pages(0).Name
        Case 1
            MsgBox Me.TabCtl0.Pages(1).Name
    End Select
End Sub

Steve
0
 

Expert Comment

by:Ei0914
ID: 35058413
I had this problem and wound up adding a main subform that was snapshot - and based on the selected record in thid continuous main subform -- had another single record subform display that record as editable. That way only 1 record was available for editing at a time. I can't unbind the form because multiple users need real-time results -- so temp tables won't work either.

I am still seeing degradation of performance intermittently, but it did improve overall performance.

Eileen
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now