Results 1 to 7 of 7

Thread: Error in SelectionFormula???

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    5,034

    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,
    Blake

  2. #2
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    Re: Error in SelectionFormula???

    crDOC.RecordSelectionFormula = "Select * From tblBatchDetail Where rowID = " & Cint(mRowID)

    try this.

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    5,034

    Re: Error in SelectionFormula???

    That didn't work Besoup...
    Blake

  4. #4
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    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?

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    5,034

    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
    Blake

  6. #6
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    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

  7. #7

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    5,034

    Re: Error in SelectionFormula???

    Thanks for the verification Bruce!
    Blake

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width