Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hide details 1

Status
Not open for further replies.

Lhuffst

Programmer
Jun 23, 2003
503
0
0
US
I have a subform that has an option group.

MainFormName: frmMainTab
SubformName : frmreports
Option Group (on frmreports) fraWhichReport
ReportName: rptMonthlyStats

fraWhichReport options
Opt 1 Person summary only report
Opt 2 Person summary and detail report
Opt 3 All People summary only report
Opt 4 All people summary and detail report

I would like to have one (maybe 2) report(s) that will show or hide the detail section based on the option button selected.
Not sure what is the best way to accomplish this and/or the vba code.
I added the following code to the details band in the report

Code:
If Forms![frmMainTab].Form![frmReports]!frawhichReport.Value = 1 Then
[indent]rptMonthlyStats.details.visible = False)][/indent]
But error condition says it can't find the subform.
My question(s) are:
1. can I pass the selected radio button as criteria (if so how?)
2. Is there a better way to do this?
Thanks
Lhuffst
 
Forms![frmMainTab].Form![frmReports]!frawhichReport.Value
Is backward. Should be
Forms![frmMainTab].[frmReports].Form.frawhichReport.Value
In general
Forms![YourFormName].[SubFormControlName].Form.ControlOnFormName.Value
 
Thanks so much. It is working now...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top