I am using CR 8.5. I have a TimeSheet report in which I only want to report on the selected employee. For test purposes, I have 14 records of one employee and 1 record for another employee. However, my report shows all the records instead of the employee I select. I don't know if I need to adjust the setting in the report or my SQL statement. I have attached my code below.

VB Code:
  1. Private Sub PrintTimeSheet()
  2.     Dim oApp As CRAXDRT.Application
  3.     Dim oReport As CRAXDRT.Report
  4.  
  5.     mSQL = "Select  A.*, " & _
  6.                    "B.*, " & _
  7.                    "C.* " & _
  8.              "From tblTime A, " & _
  9.                   "tblPayPeriods B, " & _
  10.                   "tblProjects C " & _
  11.             "Where (A.ppID = B.ppID) and " & _
  12.                   "(A.projectID = C.prjInternalProjID) and" & _
  13.                   "(A.employee = '" & mstrEmployee & "') " & _
  14.             "Order By A.employee, A.projectID"
  15.  
  16.     If OpenDBConnection Then
  17.         Set rs = New ADODB.Recordset
  18.         Set rs = cn.Execute(mSQL)
  19.         Set oApp = New CRAXDRT.Application
  20.         Set oReport = oApp.OpenReport("C:\Reports\rptTimeSheet.rpt", 1)
  21.         oReport.Database.SetDataSource rs, 3, 1
  22.         frmReport.cr1.ReportSource = oReport
  23.         frmReport.cr1.ViewReport
  24.     End If
  25. End Sub

The key is the mstrEmployee field. That value is what makes the entire report unique.

Thanks,

-Blake