I have an application that worked under CR 8.5 but since moving to CR10 I'm having trouble. Basically my problem revolves around employing the RDC method instead of using Crystl32.ocx.

The code below is an attempt at using RDC. I am having difficulty testing this because the VB debugger will not recognize breakpoints nor will it step through this module.

What am I doing wrong?

****** frmReportTicket(code) *******************

Option Explicit
Dim MyDB As CRAXDRT.Database
Dim PacDB As CRAXDRT.Database
Dim MyRSReports As CRAXDRT.DatabaseTable
Dim rsSOMast As CRAXDRT.DatabaseTable
Dim rsSOTran As CRAXDRT.DatabaseTable
Dim rsSOAddr As CRAXDRT.DatabaseTable
Dim rsARCust As CRAXDRT.DatabaseTable
Dim strMessage As String
Dim strSeek As String
Dim varCBOStateText, varListIndex
Dim strCnn As String


Private Sub cmdExit_Click()
Unload frmRptDeliveryTicket
Load MDIParent
MDIParent.Show
MDIParent.SetFocus
End Sub

Private Sub cmdRun_Click()
Const conBtns = vbOKOnly + vbInformation + vbDefaultButton1 + vbApplicationModal
Const conMsg = "You must enter some data in the field !"
Const conMsgNoScope = "Scope is either I or A !"
Const conMsgNoSONODATE = "There is no SONO with this date!"
Const conMsgNoSONO = "There is no SONO with this date!"
Dim intUserResponse As Integer
Dim strReportName As String
Dim flgTrans As Boolean ' validate SONO
Dim flgDate As Boolean ' validate the date for SONO
Dim flgAddr As Boolean
Dim dteDate As Date
Dim strSpace As String
Dim strSONO As String

txtReportScope = UCase(txtReportScope)

dteDate = DateValue(DTReportDate.Value)

If txtReportScope = "" Then
intUserResponse = MsgBox(conMsg, conBtns, "Report Scope")
txtReportScope.SetFocus
Exit Sub
End If

If txtReportScope <> "I" And txtReportScope <> "A" Then
intUserResponse = MsgBox(conMsgNoScope, conBtns, "Report Scope")
txtReportScope.SetFocus
Exit Sub
End If

If cboSONO.Text = "" And txtReportScope.Text = "I" Then
intUserResponse = MsgBox(conMsg, conBtns, "SO #")
cboSONO.SetFocus
Exit Sub
End If
If Len(Trim(cboSONO)) < 10 And Len(Trim(cboSONO)) > 0 Then
strSpace = 10 - Len(Trim(cboSONO))
If strSpace > 0 Then
cboSONO = Mid(cboSONO, strSpace + 1, 10 - strSpace)
End If
End If
' Verify that SO# is valid
If txtReportScope = "I" Then
strSpace = 10 - Len(Trim(cboSONO))
strSONO = Space(strSpace) + cboSONO
flgTrans = False
rsSOTran.MoveFirst
Do While Not rsSOTran.EOF
If rsSOTran.Fields("SONO") = strSONO Then
flgTrans = True
' check dteDate against rsSOTran.Fields("SHIPDATE")
Do While rsSOTran.Fields("SONO") = strSONO
If rsSOTran.Fields("SHIPDATE") = dteDate Then
flgDate = True
Exit Do
End If
setMoveRecord rsSOTran, "F" ' F is forward
If rsSOTran.EOF Then
Exit Do
End If
Loop
Exit Do
End If
setMoveRecord rsSOTran, "F" ' F is forward
Loop
Else
flgDate = False
' check dteDate against rsSOTran.Fields("SHIPDATE")
rsSOTran.MoveFirst
Do While Not rsSOTran.EOF
If rsSOTran.Fields("SHIPDATE") = dteDate Then
flgDate = True
Exit Do
End If
setMoveRecord rsSOTran, "F" ' F is forward
Loop
End If
If txtReportScope = "I" Then
If Not flgTrans Then
intUserResponse = MsgBox(conMsgNoSONO, conBtns, "SO#")
cboSONO.SetFocus
Exit Sub
Else
If Not flgDate Then
intUserResponse = MsgBox(conMsgNoSONODATE, conBtns, "SO# & Report Date")
cboSONO.SetFocus
Exit Sub
End If
End If
Else
If Not flgDate Then
intUserResponse = MsgBox(conMsgNoSONODATE, conBtns, "SO# & Report Date")
cboSONO.SetFocus
Exit Sub
End If
End If
flgAddr = False
rsSOAddr.MoveFirst
Do While Not rsSOAddr.EOF
If rsSOAddr.Fields("SONO") = strSONO Then
flgAddr = True
Exit Do
End If
setMoveRecord rsSOAddr, "F" ' F is forward
Loop

If flgAddr Then
strReportName = "DelTick_wShipto.rpt"
Else
strReportName = "DelTick_woShipto.rpt"
End If
Call buildReport(strReportName)
cboSONO.SetFocus

End Sub

Private Sub DTReportDate_Change()
' Load cboSONO combo
cboSONO.Clear
' Load cboSONO combo
rsSOTran.MoveFirst
Do While Not rsSOTran.EOF
If rsSOTran.Fields("SONO") <> "" And _
rsSOTran.Fields("SHIPDATE") = DTReportDate Then
If rsSOTran.Fields("SONO") <> txtTestValue Then
cboSONO.AddItem rsSOTran.Fields("SONO")
txtTestValue = rsSOTran.Fields("SONO")
End If
'Else
' cboSONO.AddItem " "
End If
'txtTestValue = cboState.Text
setMoveRecord rsSOTran, "F" ' F is forward
Loop
If cboSONO.ListCount > 0 Then
cboSONO.ListIndex = 0
End If
End Sub

Private Sub Form_Load()
Const conBtns = vbOKOnly + vbInformation + vbDefaultButton1 + vbApplicationModal
Const conMsg = "I couldn't find the Database file !"
Dim intUserResponse As Integer

On Error GoTo LoadErrorHandler
If strDataBase <> "" Then
OpenDB MyDB, strDataBase, True
Else
OpenDB MyDB, App.Path & "\ReportManager97.mdb", True
End If

Dim wrkODBC As Workspace
Dim PacDB As Connection

' Create ODBCDirect Workspace object.
Set wrkODBC = CreateWorkspace("NewODBCWorkspace", _
"admin", "", dbUseODBC)
' Open read-only Connection object based on information
' you enter in the ODBC Driver Manager dialog box.
MsgBox "Opening Connection1..."
' Set PacDB = en.OpenConnection(dsnName:"AccPacDB",,)
Set PacDB = wrkODBC.OpenConnection("Connection1", , True, "ODBC;DSN=AccPacDB;")
' dbDriverPrompt, True, "ODBC;DSN=AccPacDB;")

OpenTable MyRSReports, PacDB, "tReports"
OpenTable rsSOMast, PacDB, "somast01"
OpenTable rsSOTran, PacDB, "sotran01"
OpenTable rsSOAddr, PacDB, "soaddr01"
OpenTable rsARCust, PacDB, "arcust01"

DTReportDate.Value = Date
txtReportScope.Text = "I"
txtTestValue = ""

' Load cboSONO combo
rsSOTran.MoveFirst
Do While Not rsSOTran.EOF
If rsSOTran.Fields("SONO") <> "" And _
rsSOTran.Fields("SHIPDATE") = DTReportDate Then
If rsSOTran.Fields("SONO") <> txtTestValue Then
cboSONO.AddItem rsSOTran.Fields("SONO")
txtTestValue = rsSOTran.Fields("SONO")
End If
'Else
' cboSONO.AddItem " "
End If
'txtTestValue = cboState.Text
setMoveRecord rsSOTran, "F" ' F is forward
Loop


If cboSONO.ListCount > 0 Then
cboSONO.ListIndex = 0
End If
' cboSONO.SetFocus
Exit Sub

LoadErrorHandler:
Select Case Err.Number
Case 3024 ' Can't find file item
intUserResponse = MsgBox(conMsg, conBtns, strDataBase)
Exit Sub
Case Else
'MsgBox Err.Description, Err.Number, Err.HelpContext
Resume Next
End Select

End Sub

Private Sub buildReport(strReportName As String)
Dim mycrApp As New CRAXDDRT.Application
Dim mycrReport As New CRAXDDRT.Report
Dim strSONO As String
Dim strSpace As Integer
Dim crRptDate As String
Dim strSelectionFormula ' FORMULA TO selection criteria for REPORT
Me.MousePointer = vbHourglass
' On Error GoTo Err_CoPrt

' Set crRep = crApp.OpenReport("App.Path & " \ " & strReportName")
mycrReport.ReportFileName = App.Path & "\" & strReportName
' mycrApp.OpenReport ("App.Path & " \ " & strReportName")
crRptDate = Format$(DTReportDate, "yyyy-mm-dd")
strSpace = 10 - Len(Trim(cboSONO))
strSONO = Space(strSpace) + cboSONO

If txtReportScope = "I" Then
strSelectionFormula = "{somast01.sono} = '" & strSONO & "' and {ictran01.tdate} = Date ('" & crRptDate & "')"
Else
strSelectionFormula = "{ictran01.tdate} = Date ('" & crRptDate & "')"
End If

mycrReport.ReplaceSelectionFormula (strSelectionFormula)
'set the destination
mycrReport.Destination = mycrToPrinter

mycrReport.PrinterStartPage = 2
mycrReport.PrinterStopPage = 999

mycrReport.Action = 1
' Free memory space
Set mycrReport = Nothing
Set mycrApp = Nothing
'Printer.PaperBin = vbPRBNLower
'mycrForm.PrinterStopPage = 1
'mycrForm.Action = 1
'
' Printer.PaperBin = vbPRBNUpper
' mycrForm.PrinterStartPage = 2
' mycrForm.PrinterStopPage = 999
' mycrForm.Destination = mycrToPrinter
' mycrForm.Action = 1
strSONO = ""
crRptDate = ""
Me.MousePointer = vbDefault
Exit Sub
Err_CoPrt:
' Call Err_Handler
' ERR_Handler:
If Left(Err.Description, 19) <> "Application-defined" Then
Debug.Print Err.Number, Err.Description
End If
Resume Next

Me.MousePointer = vbDefault
Exit Sub
End Sub