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:
Set db = Workspaces(0).OpenDatabase(szDatabaseName, False, True) Set rs = db.OpenRecordset( _ "select [HCPCS].[Code] " & _ "from [HCPCS] " & _ "where [HCPCS].[Code] >= '" & szStartHCPCS & "' " & _ "and [HCPCS].[Code] <= '" & szEndHCPCS & "' " & _ "and [HCPCS].[Year] = " & szYear & " " & _ "order by [HCPCS].[Code]", _ dbOpenSnapshot) If rs.BOF Or rs.EOF Then MsgBox "CPT/HCPCS code range: " & szStartHCPCS & " thru " & szEndHCPCS & " produces no matches.", 64, "No Match Found" Else frmHCPCSReport.Hide DoEvents Set rptStand = app1.OpenReport(App.Path + "\standard.rpt") rptStand.DiscardSavedData rptStand.Database.SetDataSource rs 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.




Reply With Quote