473,386 Members | 1,668 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Form Loads slowly caused by faulty data???

I have a form containing a listbox that when a line is selected in it, it opens another form containing data based on the selection (using a query that is dynamically altered for the new form's recordsource)

ANYWAYS, the form takes about 30 seconds to load.

The tables involved in the recordsource query total about 12,000 records which isn't nearly enough to slow the process down this much.

I set breakpoints and traced the code to the point where the program attempts to open the new form using the DoCmd.Open "formName" command.

At that point is when the program freezes for 30 seconds.

The new form's load and open events aren't even touched during that time period. They are executed once the 30 seconds are up.

. I also noticed that if i take all the contraints off the tables that are involved in the query, the load time is 3-5 seconds!

let me know of anything that may help me diagnose this problem please. maybe commenting on process flow or something.
Jul 10 '07 #1
1 2544
puppydogbuddy
1,923 Expert 1GB
I have a form containing a listbox that when a line is selected in it, it opens another form containing data based on the selection (using a query that is dynamically altered for the new form's recordsource)

ANYWAYS, the form takes about 30 seconds to load.

The tables involved in the recordsource query total about 12,000 records which isn't nearly enough to slow the process down this much.

I set breakpoints and traced the code to the point where the program attempts to open the new form using the DoCmd.Open "formName" command.

At that point is when the program freezes for 30 seconds.

The new form's load and open events aren't even touched during that time period. They are executed once the 30 seconds are up.

. I also noticed that if i take all the contraints off the tables that are involved in the query, the load time is 3-5 seconds!

let me know of anything that may help me diagnose this problem please. maybe commenting on process flow or something.
Here are some great tips and references to check out.

1. Turn off problem properties:
http://allenbrowne.com/bug-09.html

2. Visit Tony Toews’ Web Site for Performance Tips
http://www.granite.ab.ca/access/performancefaq.htm

3. Tips to Speed up your Access 2000 Forms

From the tips page of aadconsulting:
A tip from Mark Plumpton of www.customdata.co.nz

I have a form that took 85 seconds to save. After applying the technique below it reduced the save time to just a couple of seconds. It also reduced my compacted database size from 5mb to 4mb after applying this technique.

This is the tip: Load the form, subform, combobox and listbox record sources at run-time. That's it. You will achieve dramatic performance improvement and reduced database size.

Here's the technique: Delete the SQL from the RecordSource and RowSource properties of the form, subforms, comboboxes and listboxes. Now in the Form_Load event load the appropriate SQL as follows ...

Private Sub Form_Load()
Me.RecordSource = "qryLargeTable"
Me.txtSomeField.RowSource = _
"SELECT SomeField " & _
"FROM qryLargeTable " & _
"GROUP BY SomeField " & _
"ORDER BY SomeField;"
End Sub

It also pays to clear the record sources in the Unload event as sometime these get saved with the form in Access 2000.

Private Sub Form_Unload(Cancel As Integer)
Me.RecordSource = ""
Me.cboFindRecord.RowSource = ""
End Sub

4. Tips to Improve Subform Performance
Also from the tips page of aadconsulting:
http://www.aadconsulting.com/aadtips.html

Base subforms on queries rather than tables. Include only required fields from the record source.
Index all the fields on the subform that are linked to the main form. Indexes speed up the matching of subform records.
Index any fields used for criteria such as where a subform is based on a parameter query.
If you are linking on multiple fields, add a calculated field to the main form that concatenates the fields. Then, create a calculated column in the subform's RecordSource property query with the same expression.

For example, to link to the subform on an Employee ID field and an Order ID field, add a text box to the main form with the following properties:

Name: EmployeeIDOrderID
ControlSource: =[EmployeeID] & [OrderID]

Next, add the following field to the query that the subform is based on:

EmployeeIDOrderID: [Employee ID] & [Order ID]

Then, link the main form and the subform on the concatenated field rather than on the two individual fields. The subform properties might look as follows:

LinkChildFields: EmployeeIDOrderID
LinkMasterFields: EmployeeIDOrderID

Because Access only has to compare one criteria to return the subform's recordset, the subform's performance should improve. Set the subform's DefaultEditing property to Read-Only if the records in the subform are not going to be edited.
If your subform is a continuous form and contains combo boxes, explicitly justify the combo box in the subform's form Design view. This prevents Access from determining the proper justification of the combo box values for each record and thus speeds the display of subform records which have combo boxes.
5. Dynamically load Subform on Page Change of Tab Control
http://www.databasejournal.com/featu...le.php/3599781
Jul 10 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Saqib Ali | last post by:
Please excuse me, this is a fairly involved question that will likely require you to save the file below to a file and open it in a browser. I use Mozilla 1.5, so the problem I describe below...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
9
by: Lyn | last post by:
Hi, I have a form which is opened from a button on another form. The form is used to display a list of records from a recordset in Continuous Mode. It is sized vertically to display about 25...
2
by: mar10 | last post by:
I've been working on a database with several tables that I've established relationships for. I needed to add some fields to one of the tables and before I did anything to my current table I...
5
by: Samy | last post by:
Hi There, I have a stored procedure which takes 7 sec to execute. I am using a adapter and filling the dataset. Then I bind the datagrid with the datatable from the dataset. When I test the page...
10
by: Sarah Smith | last post by:
Hello, I am a bit of a newbie to VB.NET, but not totally new. I took the plunge recently and decided (along with my colleagues), to try to convert/port a VB6 client/server app to .Net. (I'm...
1
by: Rohit111111 | last post by:
I have my base form which has background image , tool bar etc,All other forms inherit it. The background image size is162kb and it is in PNG format.All the other forms also has many images since...
0
by: Vyas111111 | last post by:
I have my base form which has background image , tool bar etc,All other forms inherit it. The background image size is162kb and it is in PNG format.All the other forms also has many images since we...
1
by: prakashwadhwani | last post by:
I have an app containing 9 forms which have approximately 2 to 3 combo boxes and 7 to 8 text boxes + a few labels (in each form). On the same PC the forms open very fast. However when I load the...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.