DataReport is giving error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • switroz
    New Member
    • Sep 2011
    • 1

    DataReport is giving error

    Good Day,

    Below is my codes:

    Code:
    Private Sub btnRpt1_Click()
        Dim strBC, strDBI, strDBN, strJouFrm, strJouTo, strSQL, strTransDate, recCou As String
        strIndex = cmbDBR.ListIndex + 1
        strDBI = Check_DB(strIndex, "ID")
        strDBN = Check_DB(strIndex, "NM")
        strBC = txtBCR.Text
        strJouFrm = txtJouFrmR.Text
        strJouTo = txtJouToR.Text
        strTransDate = strPayDate2
        If txtBCR.Text = "" Or txtJouFrmR.Text = "" Or txtJouToR.Text = "" Then
            MsgBox "Please Key In All The Field !", vbOKOnly, "Validation"
        Else
            Screen.MousePointer = 11
    
            On Error Resume Next
    
            Dim de As New dtenvRpt
            Dim QryDef As New ADODB.Recordset
    
            strSQL = "select * from table_name"
    
            Call OpenConnection
            QryDef.Open strSQL, conn
            recCou = QryDef.RecordCount
    
            Set de = New dtenvRpt
            Set rptSum.DataSource = de
    
                If recCou = 0 Then
                    MsgBox "No Data. Please check your inputs.", vbOKOnly, "REPORTS"
                    Exit Sub
                Else
                    With rptSum.Sections("pageheader")
                        .Controls("lblPayDateVal").Caption = strTransDate
                    End With
    
                    rptSum.Show
    
                    Err = 0
                    Set de = Nothing
                    Unload dtenvRpt
                End If
    
            CloseConnection
        End If
    End Sub
    I am trying to pass a value to report which is date selected by user but the report is not opening. It gives me error; "failed getting rowset(s) from current data source".

    Please guide me, thank you. :)
Working...