martinpratt
Registered User.
- Local time
- Today, 23:44
- Joined
- Oct 17, 2012
- Messages
- 22
Hello all,
I am a complete noobie with access, but I have managed to get some working reports which run from queries, whose info comes from linked tables.
The problem I have is with the code running very very slow....
To give some details, I have a query which I have added two parameters. When I run this directly it take aroud 2secs to complete the query.
I have a report on this query which takes around 4secs to complete.
But, if I remove the parameters and use a form to send the required parameters, the report now takes more than 60secs to run!
The form is a simple two box, two button form with the following code....
Option Compare Database
Option Explicit
Private Sub cancel_Click()
DoCmd.Close acForm, "Show BoM", acSaveNo
End Sub
Private Sub show_bom_Click()
If Me![assy_no] <> "" Then
DoCmd.OpenReport "BoM", acViewReport, , "pstk = '" & Me!assy_no & "'" & "And issue = '" & Me!issue_no & "'"
DoCmd.Close acForm, "Show BoM", acSaveNo
Else
DoCmd.Close acForm, "Show BoM", acSaveNo
End If
End Sub
It seems to take around 56secs to before the form closes and the status bar says "running query" and then around 4secs later the report appears.
It seems to me to be a problem with the DoCmd.OpenReport code.
Any ideas to speed this up will be gratfully received.
Thanks you
by the way I am using MS Access 2010
Martin
I am a complete noobie with access, but I have managed to get some working reports which run from queries, whose info comes from linked tables.
The problem I have is with the code running very very slow....
To give some details, I have a query which I have added two parameters. When I run this directly it take aroud 2secs to complete the query.
I have a report on this query which takes around 4secs to complete.
But, if I remove the parameters and use a form to send the required parameters, the report now takes more than 60secs to run!
The form is a simple two box, two button form with the following code....
Option Compare Database
Option Explicit
Private Sub cancel_Click()
DoCmd.Close acForm, "Show BoM", acSaveNo
End Sub
Private Sub show_bom_Click()
If Me![assy_no] <> "" Then
DoCmd.OpenReport "BoM", acViewReport, , "pstk = '" & Me!assy_no & "'" & "And issue = '" & Me!issue_no & "'"
DoCmd.Close acForm, "Show BoM", acSaveNo
Else
DoCmd.Close acForm, "Show BoM", acSaveNo
End If
End Sub
It seems to take around 56secs to before the form closes and the status bar says "running query" and then around 4secs later the report appears.
It seems to me to be a problem with the DoCmd.OpenReport code.
Any ideas to speed this up will be gratfully received.
Thanks you
by the way I am using MS Access 2010
Martin