I need to upgrade some reports for the VS VB6 built in Crystal 4.0 to Crystal 9.0… I am using DAO recordsets and cannot get Crystal to load only specific data, it loads the entirety of the database. My code is below

all variables have been declared properly.

VB Code:
  1. Set db = Workspaces(0).OpenDatabase(szDatabaseName, False, True)
  2.    
  3.     Set rs = db.OpenRecordset( _
  4.             "select [HCPCS].[Code] " & _
  5.               "from [HCPCS] " & _
  6.                 "where [HCPCS].[Code] >= '" & szStartHCPCS & "' " & _
  7.                     "and [HCPCS].[Code] <= '" & szEndHCPCS & "' " & _
  8.                     "and [HCPCS].[Year] = " & szYear & " " & _
  9.                 "order by [HCPCS].[Code]", _
  10.             dbOpenSnapshot)
  11.                      
  12. If rs.BOF Or rs.EOF Then
  13.     MsgBox "CPT/HCPCS code range: " & szStartHCPCS & " thru " & szEndHCPCS & " produces no matches.", 64, "No Match Found"
  14. Else
  15.     frmHCPCSReport.Hide
  16.     DoEvents
  17.     Set rptStand = app1.OpenReport(App.Path + "\standard.rpt")
  18.     rptStand.DiscardSavedData
  19.     rptStand.Database.SetDataSource rs
  20.     rptStandard.Show

When this loads it gives me everything not what is selected. Any ideas? Excuse my ignorance on this, I am new to the new Crystal reports.

Thanks in advance.