Error in SelectionFormula???
I'm currently using Crystal Reports 10. I have a report where the RecordSelectionFormula is set to:
Code:
crDOC.RecordSelectionFormula = "Select * From tblBatchDetail Where rowID = " & mRowID
I get the following error message when this statement is executed. Please see attached screen print. Can I have my statement in a format such as this?
Thanks,
Re: Error in SelectionFormula???
crDOC.RecordSelectionFormula = "Select * From tblBatchDetail Where rowID = " & Cint(mRowID)
try this.
Re: Error in SelectionFormula???
That didn't work Besoup...
Re: Error in SelectionFormula???
hmm not sure what is causing it... can you just pass the row as a parameter to the report and use the selection expert inside of the report to execute the query?
Re: Error in SelectionFormula???
Well, what I had before seemed to be working, except my report was getting more data than it should have been. The formula before was this:
crDOC.RecordSelectionFormula = "{tblBatchDetail.rowID}=" & mRowID
Re: Error in SelectionFormula???
The RecordSelectionFormula is not a sql statement. It lets you specify different criterias or "programming logic". If possible Crystal will apply the different items within the formula to the Where clause. If not possible Crystal will first get the data from the database and then pass through all the data removing records that don't fit the formula.
This should be all you need.
crDOC.RecordSelectionFormula = "{tblBatchDetail.rowID} = " & mRowID
Re: Error in SelectionFormula???
Thanks for the verification Bruce!