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!

Passing RecordSelectionFormula to Subreport

Status
Not open for further replies.

albaken

Programmer
Jan 22, 2001
9
0
0
US
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.
 
I don't know VB. But if you can get the values into formula fields in the main report, you should be able to pass them to the subreport using Edit > Subreport Links. Making such links automatically makes them selection criteria in the subreport. You may need to edit this.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top