Please help,
I have a form called frmMain, containing a Subform called sformCasenotes. SubformCasenotes is a datasheet form with a button which I want to use to print the individual entry in the datasheet. The unique identifier on this subform is called CaseID. The field that binds these 2 forms is ID
The report I have set up is called rptCasenoteEntry, it is based on the table that frmMain is based on, and has contains a subreport called srptCasenotes. I have put the CaseID field in the header of the subreport (and made it not visible). The field that binds these reports is ID
I have set up the following macro to assign to the button to print the correct document:
OpenReport
Name: rptCasenoteEntry
View: Print Preview
Where:
[Reports]![rptCasenoteEntry]![srptCasenotes].[Report]![CaseID]=[Forms]![frmMain]![sformCasenotes].[Form]![CaseID]
Incidentally, I didn’t put [] around Reports and Form, Access seems to be doing that for me (I enter this: Reports![rptCasenoteEntry]![srptCasenotes].Report![CaseID]=Forms![frmMain]![sformCasenotes].Form![CaseID] in the box)
When I click the button I get a report with Error in the fields in the parent report and a no subreport.
Please can you advise what i'm doing wrong.
Thanks
Kev
I have a form called frmMain, containing a Subform called sformCasenotes. SubformCasenotes is a datasheet form with a button which I want to use to print the individual entry in the datasheet. The unique identifier on this subform is called CaseID. The field that binds these 2 forms is ID
The report I have set up is called rptCasenoteEntry, it is based on the table that frmMain is based on, and has contains a subreport called srptCasenotes. I have put the CaseID field in the header of the subreport (and made it not visible). The field that binds these reports is ID
I have set up the following macro to assign to the button to print the correct document:
OpenReport
Name: rptCasenoteEntry
View: Print Preview
Where:
[Reports]![rptCasenoteEntry]![srptCasenotes].[Report]![CaseID]=[Forms]![frmMain]![sformCasenotes].[Form]![CaseID]
Incidentally, I didn’t put [] around Reports and Form, Access seems to be doing that for me (I enter this: Reports![rptCasenoteEntry]![srptCasenotes].Report![CaseID]=Forms![frmMain]![sformCasenotes].Form![CaseID] in the box)
When I click the button I get a report with Error in the fields in the parent report and a no subreport.
Please can you advise what i'm doing wrong.
Thanks
Kev