I have a 8.5 report in my VB app. I need to have it list only those records that have a dateclosed but not paid between the dates the user inputs on a vb form.
Here is what I have in the form that contains the viewer for the report.
Private Sub Form_Load()
Me.WindowState = vbMaximized
Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = Report
Report.ParameterFields(1).AddCurrentValue (frmOutstandingInvoices.DataCombo1.Text)
Report.ParameterFields(startdate).AddCurrentValue (frmOutstandingInvoices.Text2.Text)
Report.ParameterFields(enddate).AddCurrentValue (frmOutstandingInvoices.Text3.Text)
CRViewer1.ViewReport
Screen.MousePointer = vbDefault
Set Report = Nothing
End Sub
The report works fine for showing the client that has been invoiced but hasn't paid, but I added the startdate and enddate parameterfields to the report and as shown above am trying to have those parameters used in the report when I run this I get this error-- subscript out of range. If I take them out of the form load that has the viewer then of course the report prompts for the startdate and enddate and then will show those dates on the report. I still need to have some kinda formula so the report only lists between those dates.
So I need help with why I can't insert the parameters in the viewer form and have that part work and then help for doing the formula part.
Thanks for any and all help
Here is what I have in the form that contains the viewer for the report.
Private Sub Form_Load()
Me.WindowState = vbMaximized
Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = Report
Report.ParameterFields(1).AddCurrentValue (frmOutstandingInvoices.DataCombo1.Text)
Report.ParameterFields(startdate).AddCurrentValue (frmOutstandingInvoices.Text2.Text)
Report.ParameterFields(enddate).AddCurrentValue (frmOutstandingInvoices.Text3.Text)
CRViewer1.ViewReport
Screen.MousePointer = vbDefault
Set Report = Nothing
End Sub
The report works fine for showing the client that has been invoiced but hasn't paid, but I added the startdate and enddate parameterfields to the report and as shown above am trying to have those parameters used in the report when I run this I get this error-- subscript out of range. If I take them out of the form load that has the viewer then of course the report prompts for the startdate and enddate and then will show those dates on the report. I still need to have some kinda formula so the report only lists between those dates.
So I need help with why I can't insert the parameters in the viewer form and have that part work and then help for doing the formula part.
Thanks for any and all help