I am running a report with no selection formula, that has a subreport attached. The selection formula is included in the code when a user clicks on a button in VB6. How, or can, I pass the selection formula to the subreport as well?
Here is the code on the button click:
PlayWave1
Dim Report As New OxyMonthlyIV
Screen.MousePointer = vbHourglass
Dim cpproperty As CRAXDDRT.ConnectionProperty
Dim dbtable As CRAXDRT.DatabaseTable
Set dbtable = Report.Database.Tables(1)
dbtable.Location = "w:\hbodata\OxyhealBridgeportNopassword.mdb"
Set cpproperty = dbtable.ConnectionProperties("Database password")
cpproperty.Value = "4231"
CRViewer1.ReportSource = Report
Report.RecordSelectionFormula = "{pt_data.diveday} >= date(2008,12,01) and {pt_data.diveday}<= date(2008,12,31) "
'Report.ReportTitle = "HBO SummaryBy Dx Fiscal 2004"
Reports.Caption = "December 2008 "
Report.FormulaFields.GetItemByName("RptTitle").Text = "'December 2008'"
CRViewer1.ViewReport
Xrep.Visible = True
CRViewer1.EnableCloseButton = True
Reports.WindowState = vbMaximized
Screen.MousePointer = vbDefault
Any help or info would be appreciated.
Here is the code on the button click:
PlayWave1
Dim Report As New OxyMonthlyIV
Screen.MousePointer = vbHourglass
Dim cpproperty As CRAXDDRT.ConnectionProperty
Dim dbtable As CRAXDRT.DatabaseTable
Set dbtable = Report.Database.Tables(1)
dbtable.Location = "w:\hbodata\OxyhealBridgeportNopassword.mdb"
Set cpproperty = dbtable.ConnectionProperties("Database password")
cpproperty.Value = "4231"
CRViewer1.ReportSource = Report
Report.RecordSelectionFormula = "{pt_data.diveday} >= date(2008,12,01) and {pt_data.diveday}<= date(2008,12,31) "
'Report.ReportTitle = "HBO SummaryBy Dx Fiscal 2004"
Reports.Caption = "December 2008 "
Report.FormulaFields.GetItemByName("RptTitle").Text = "'December 2008'"
CRViewer1.ViewReport
Xrep.Visible = True
CRViewer1.EnableCloseButton = True
Reports.WindowState = vbMaximized
Screen.MousePointer = vbDefault
Any help or info would be appreciated.