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