|
-
Feb 17th, 2005, 04:51 PM
#1
Thread Starter
New Member
Crystal Migration
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.
-
Feb 19th, 2005, 12:35 AM
#2
Re: Crystal Migration
Welcome to the Forums.
Make sure you recordset is returning the correct data first. Also add the
correct parameters to the ReportSource property as i show below.
VB Code:
rptStand.Database.SetDataSource rs, 3, 1
I cant remember but dont you need a boolean (True/False) after .DiscardSavedData?
VB Code:
rptStand.DiscardSavedData = True
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|