Hello,
I would be very grateful if someone could assist me with the following problem. We are in the process of migrating an Access 2003 Data Project (.ADP) to Access 2010. In the Access 2003 project (which works correctly), we have a report that is configured with InputParameters (found in the Design View under the Data tab) set to the following:
@intYear int = [Reports]![rptShippedWeightsPosition].pYear, @strCompanyList varchar(1000) = [Reports]![rptShippedWeightsPosition].pCompanyList, @strProductList varchar(1000) = [Reports]![rptShippedWeightsPosition].pProductList, @strContractList varchar(1000) = [Reports]![rptShippedWeightsPosition].pContractList
In the above declaration, pYear, pCompanyList, pProductList and pContractList all refer to properties on the report whose implementations are as follows:
Public Property Get pYear() As Variant
pYear = m_year
End Property
Public Property Get pCompanyList() As Variant
pCompanyList = m_CompanyList
End Property
Public Property Get pProductList() As Variant
pProductList = m_ProductList
End Property
Public Property Get pContractList() As Variant
pContractList = m_ContractList
End Property
In the Access 2003 project, the InputParameters declaration is working correctly - we have confirmed by using breakpoints that the four properties above are executed when the report is created, and the report gives us the results that we are expecting.
However, when we migrated this ADP to Access 2010, we discovered that the InputParameters were no longer working. When the report is run in Access 2010, the end-user is prompted to enter values for the parameters instead. We changed the InputParameters declaration in Access 2010 to the following (effectively replacing the occurrences of '.' with '!'):
@intYear int = [Reports]![rptShippedWeightsPosition]!pYear, @strCompanyList varchar(1000) = [Reports]![rptShippedWeightsPosition]!pCompanyList, @strProductList varchar(1000) = [Reports]![rptShippedWeightsPosition]!pProductList, @strContractList varchar(1000) = [Reports]![rptShippedWeightsPosition]!pContractList
This resolved the problem of the end-user being prompted to enter values for the parameters, however the four Get Properties (implementations shown above) were no longer being executed. As a consequence, the results in the generated report were incorrect.
I have tried a number of permutations to get the InputParameters working in Access 2010, namely:
- putting braces around pYear, pCompanyList etc. - i.e. @intYear int = [Reports]![rptShippedWeightsPosition]![pYear] etc.
- putting brackets after pYear, pCompanyList etc. - i.e. @intYear int = [Reports]![rptShippedWeightsPosition]![pYear()] etc.
- Removing the datatype from pYear, pCompanyList etc. - i.e. @intYear = [Reports]![rptShippedWeightsPosition]![pYear] etc.
- Following recommendations on setting the RecordSource property as posted in a similar issue: http://stackoverflow.com/questions/8...s-on-form-load
Unfortunately, none of these attempts have succeeded - in Access 2010, the Get Properties are still not being executed and the report (which worked in Access 2003) is now giving us incorrect results.
I would be very grateful if anyone could provide any suggestions as to what the resolution may be - please let me know if anything is unclear, or if you require any further information in order to help diagnose the issue.
Many thanks,
Ryan