I need to open a report that is based on a parameterized query. The report can be opened from a variety of forms that users have to access to open the report. I know how to use the do command to open the report and pass a filter argument but that doesn’t work if the report is based on parameters. I don’t want to change the source of the parameters to a control on the form because this report can be accessed from several different forms and the query itself is used in several different reports showing different amounts of detail.
I’ve always been taught that it’s better to open a report with the data you want to see rather than opening a report and then applying a filter after it is opened. Even if I wanted to, I’m not allowed to change the report or the query so I’m stuck with the parameterized query and making it work. The query is fairly complex with several tables one of which has over 200,000 rows.
he source of the parameters to a control on the form because this report can be accessed from several different forms and the query itself is used in several different reports showing different amounts of detail.
I can use this code to open a form based on the parameterized query but when I tried to use it on a report I got a message “This feature is only available in and ADP” and my tables are based on ODBC tables from a pervasive database and not an sql server ADP.
uery and making it work. The query is fairly complex with several tables one of which has over 200,000 rows.
he source of the parameters to a control on the form because this report can be accessed from several different forms and the query itself is used in several different reports showing different amounts of detail.
This is my code I can use to open a form
Is there any way to open this report as it is without removing the parameters and using a filter argument instead?
I'm using MS Access 2010
I’ve always been taught that it’s better to open a report with the data you want to see rather than opening a report and then applying a filter after it is opened. Even if I wanted to, I’m not allowed to change the report or the query so I’m stuck with the parameterized query and making it work. The query is fairly complex with several tables one of which has over 200,000 rows.
he source of the parameters to a control on the form because this report can be accessed from several different forms and the query itself is used in several different reports showing different amounts of detail.
I can use this code to open a form based on the parameterized query but when I tried to use it on a report I got a message “This feature is only available in and ADP” and my tables are based on ODBC tables from a pervasive database and not an sql server ADP.
uery and making it work. The query is fairly complex with several tables one of which has over 200,000 rows.
he source of the parameters to a control on the form because this report can be accessed from several different forms and the query itself is used in several different reports showing different amounts of detail.
This is my code I can use to open a form
Code:
Private Sub Form_Open(Cancel As Integer)
'This doesn't work on a report
Dim mydb As dao.Database
Dim Myqdf As dao.QueryDef
Set mydb = CodeDb
Set Myqdf = mydb.QueryDefs("qryPODetails")
Myqdf.Parameters("WhatPO").Value = "0008009"
Set Me.Recordset = Myqdf.OpenRecordset
End Sub
Is there any way to open this report as it is without removing the parameters and using a filter argument instead?
I'm using MS Access 2010