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 dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selection formula for CR XI report on VB.NET frontend

Status
Not open for further replies.

ribbons

Technical User
Apr 26, 2007
113
US
I have a VB.NET front end pulling a CR XI report based on an Access DB.

This should be a simple front end that filters data displayed on this report.

The user selects a date from a combobox and clicks a button that reloads and redisplays the form based on the combobox selection. The button calls the following subroutine:

Code:
 Private Sub Find_Reports_By_Date_Finished()

S_PurityGermMixReport = New ReportDocument
Dim reportPath As String = "C:\Documents and Settings\imbrka\Desktop\Forms for Testing\S_PurityGermMix.rpt"
S_PurityGermMixReport.Load(reportPath)

Dim selectionFormula As String = "({GermReadings.GermFinishedDate}) = #" _
        & datefinished _
        & "'"

        S_PurityGermMixReport.DataDefinition.RecordSelectionFormula = selectionFormula
        CrystalReportViewer1.ReportSource = S_PurityGermMixReport

    End Sub

However, the form refuses to display any information using this date combobox. It works just fine with some other comboboxes as long as the combobox is providing strings such as company names and other TEXT parameters.

I suspect that I have something wrong with the syntax of the record selection formula as pertains to using DATES, but I don't know what.

Code:
 Dim selectionFormula As String = "({GermReadings.GermFinishedDate}) = #" _
        & datefinished _
        & "'"

Is this formatting right?

ribbons

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top