Hi, I'm using 2 DateTimePickers and a Button to display a report in a date range, in the report I have no formulas and I only show the Order Date and the Order Id of the xtreme database Orders table.
this is the routine in the Button:
Private Sub btnReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnReport.Click
Dim myReport As New rptOrderHistory
Dim OrdersPreview As New frmPreviewReport(myReport)
If chkUseDates.Checked Then
Dim DateRange As String
DateRange = "{Orders.Order Date} in CDate(DateTimePicker1) to CDate(DateTimePicker2)"
myReport.DataDefinition.RecordSelectionFormula = DateRange
MsgBox(DateRange)
End If
OrdersPreview.ShowDialog()
End Sub
I'm getting a runtime error, the message is that there's a ) missing,
the DateRange string is exactlly this
"{Orders.Order Date} in CDate(DateTimePicker1) to CDate(DateTimePicker2)"
but it doesn't work because I need to pass the DateTimePicker1 and 2 as strings