![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Apart from waiting an arbitrary period before making a Form visible is there no way in Access to know when all data has been calculated so that the Form can be rendered in one go. The Form in question is continuous with a Query Recordsource that contains several DCount fields. I've optimised the query as much as I can (saved it, indexes table fields etc.) but the Form is rendered in 'chunks' of records. I've tried all obvious tweeks including: Dim F as New myForm DoEvents myForm.Visible = True (after Visible = False in the Form's open event) to no avail Any comments/ideas? Thanks Jon |
#3
| |||
| |||
|
|
The Form in question is continuous with a Query Recordsource that contains several DCount fields. |
#4
| |||
| |||
|
|
You might try something like the following. In my simple test it seemed to work Public Sub sOpenPopulated() Dim sFormName As String sFormName = "frmCalendarTable" DoCmd.OpenForm sFormName, acNormal, , , , acHidden With Forms(sFormName) .RecordsetClone.MoveLast .Bookmark = .RecordsetClone.Bookmark .RecordsetClone.MoveFirst .Bookmark = .RecordsetClone.Bookmark .Visible = True End With End Sub John Spencer Access MVP 2002-2005, 2007-2010 The Hilltop Institute University of Maryland Baltimore County Jon Lewis wrote: Apart from waiting an arbitrary period before making a Form visible is there no way in Access to know when all data has been calculated so that the Form can be rendered in one go. The Form in question is continuous with a Query Recordsource that contains several DCount fields. I've optimised the query as much as I can (saved it, indexes table fields etc.) but the Form is rendered in 'chunks' of records. I've tried all obvious tweeks including: Dim F as New myForm DoEvents myForm.Visible = True (after Visible = False in the Form's open event) to no avail Any comments/ideas? Thanks Jon |
#5
| |||
| |||
|
|
"Jon Lewis" <jon.lewis (AT) cutthespambtinternet (DOT) com> wrote in news:ZPSdnSU6r84O3BvRnZ2dnUVZ7vydnZ2d (AT) bt (DOT) com: The Form in question is continuous with a Query Recordsource that contains several DCount fields. Remove the DCounts from the recordsource and show use them as ControlSources in textboxes on the form. Or, figure out a way to avoid needing them in the first place. -- David W. Fenton http://www.dfenton.com/ contact via website only http://www.dfenton.com/DFA/ |
#6
| |||
| |||
|
|
If you post the SQL of your current query, it might be possible to suggest changes to the query. Or instead of having the DCount calculations in the query, it might be possible to set them up on the form's controls (at least in some cases). Do you need to be able to update the records that are being displayed? John Spencer Access MVP 2002-2005, 2007-2010 The Hilltop Institute University of Maryland Baltimore County John Spencer wrote: You might try something like the following. In my simple test it seemed to work Public Sub sOpenPopulated() Dim sFormName As String sFormName = "frmCalendarTable" DoCmd.OpenForm sFormName, acNormal, , , , acHidden With Forms(sFormName) .RecordsetClone.MoveLast .Bookmark = .RecordsetClone.Bookmark .RecordsetClone.MoveFirst .Bookmark = .RecordsetClone.Bookmark .Visible = True End With End Sub John Spencer Access MVP 2002-2005, 2007-2010 The Hilltop Institute University of Maryland Baltimore County Jon Lewis wrote: Apart from waiting an arbitrary period before making a Form visible is there no way in Access to know when all data has been calculated so that the Form can be rendered in one go. The Form in question is continuous with a Query Recordsource that contains several DCount fields. I've optimised the query as much as I can (saved it, indexes table fields etc.) but the Form is rendered in 'chunks' of records. I've tried all obvious tweeks including: Dim F as New myForm DoEvents myForm.Visible = True (after Visible = False in the Form's open event) to no avail Any comments/ideas? Thanks Jon |
#7
| |||
| |||
|
|
Removing the DCounts form the recordsource to the relevant controls does help but there is of course still a delay in the controls themselves populating. |
#8
| |||
| |||
|
|
"Jon Lewis" <jon.lewis (AT) cutthespambtinternet (DOT) com> wrote in news:3IadnZh1T7iS-ArRnZ2dnUVZ8uidnZ2d (AT) bt (DOT) com: Removing the DCounts form the recordsource to the relevant controls does help but there is of course still a delay in the controls themselves populating. What about replacing the DCounts() with subqueries? |
#9
| |||
| |||
|
|
On 20/09/2010 21:31:32, "David W. Fenton" wrote: "Jon Lewis" <jon.lewis (AT) cutthespambtinternet (DOT) com> wrote in news:3IadnZh1T7iS-ArRnZ2dnUVZ8uidnZ2d (AT) bt (DOT) com: Removing the DCounts form the recordsource to the relevant controls does help but there is of course still a delay in the controls themselves populating. What about replacing the DCounts() with subqueries? Allen Brown has a number of functions which are reported to ne much faster than the inbuilt "D" functions including ELookup, EMin, EFirst, ESum etc. They work in exactly the same way as the eqivalent DLookup, DMin, DFirst, DSum etc |
#10
| |||
| |||
|
|
"Phil" <phil (AT) stantonfamily (DOT) co.uk> wrote in news:tcSdnea2mMVEfQrRnZ2dnUVZ7sSdnZ2d (AT) brightview (DOT) co.uk: On 20/09/2010 21:31:32, "David W. Fenton" wrote: "Jon Lewis" <jon.lewis (AT) cutthespambtinternet (DOT) com> wrote in news:3IadnZh1T7iS-ArRnZ2dnUVZ8uidnZ2d (AT) bt (DOT) com: Removing the DCounts form the recordsource to the relevant controls does help but there is of course still a delay in the controls themselves populating. What about replacing the DCounts() with subqueries? Allen Brown has a number of functions which are reported to ne much faster than the inbuilt "D" functions including ELookup, EMin, EFirst, ESum etc. They work in exactly the same way as the eqivalent DLookup, DMin, DFirst, DSum etc Is it not the case that these were faster only until A2000? The problem was that the domain aggregate functions were slow on linked tables, so many of us used replacement functions. I used Trevor Best's tCount() functions. But with A2000, I thought that bug was fixed, so they were no longer necessary. I already suggested replacing them with custom functions, and it's only if that didn't work that I suggested subqueries. |
![]() |
| Thread Tools | |
| Display Modes | |
| |