I need to pass a parameter to a stored procedure from a report in an .adp access project. Normally I would just put this in the Input Parameters property of the report. Example
@to_date = forms![frm_rpt_mstr]![toDate]
The issue that I am having is when running the report; it is not seeing the control or the form. This I believe is due to how I am calling/opening the form. I have a tree list control on the main form. When a node is clicked, it changes the SourceObject of a subform. Example
Me.sfmGeneric.SourceObject = str_doc_open
Me.sfmGeneric.Form.Requery
When opening the form this way my report does not see the parameter. If I just open the form directly the report runs and works normally
Is there another way to pass this parameter to the report?
Thanks,
Winston
Input Parameters on a Report
-
- Lounger
- Posts: 32
- Joined: 07 Jun 2010, 17:51
Re: Input Parameters on a Report
I had to step away from this project for a couple of days due to failed Windows 7 SP1 installations. Once I got back though, it hit me that you have to reference the parent form then the sub form. Changing the Input Parameters property on the report to @to_date = Forms![frm_tree].[sfmGeneric].form![tDate] the report runs correctly.
It has been a few years since I had to work with Access, SQL, and VBA that I might have forgotten more than I thought. I think I should dust off some of the old study guides.
Winston
It has been a few years since I had to work with Access, SQL, and VBA that I might have forgotten more than I thought. I think I should dust off some of the old study guides.
Winston
-
- Administrator
- Posts: 78558
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands