Tim Johnson
New member
- Local time
- Today, 19:56
- Joined
- Feb 15, 2000
- Messages
- 8
I have a Parent Form X that has a tab control on it. On one of the tabs in the tab control I have a Subform Y.
I want to be able to print a report for a specific record in Subform Y.
When I run Subform Y by itself (not as a Subform of Parent Form X) and click on the button to create a report for a specific record it works fine. I am using the following code in the OnClick Event of the Preview Report Button:
DoCmd.OpenReport "ReportName",acPreview, ,
"[UniqueFieldName]=Forms![subformName]![UniqueFieldName]"
When I run Subform Y (on the tab control) through Parent Form X and click on the Preview Report Button I am prompted for the UniqueFieldName even though it is present on Subform Y.
I have tried placing the Preview Report Button on the Tab that Subform Y is on as well with the same results.
Do I need to refer to the UniqueFieldName on Subform Y differently since I am trying to access that field through Parent Form X and a tab control?
Any help would be greatly appreciated.
Thanks in advance,
Tim Johnson
I want to be able to print a report for a specific record in Subform Y.
When I run Subform Y by itself (not as a Subform of Parent Form X) and click on the button to create a report for a specific record it works fine. I am using the following code in the OnClick Event of the Preview Report Button:
DoCmd.OpenReport "ReportName",acPreview, ,
"[UniqueFieldName]=Forms![subformName]![UniqueFieldName]"
When I run Subform Y (on the tab control) through Parent Form X and click on the Preview Report Button I am prompted for the UniqueFieldName even though it is present on Subform Y.
I have tried placing the Preview Report Button on the Tab that Subform Y is on as well with the same results.
Do I need to refer to the UniqueFieldName on Subform Y differently since I am trying to access that field through Parent Form X and a tab control?
Any help would be greatly appreciated.
Thanks in advance,
Tim Johnson