Private Sub cmdPrint_Click()

Dim cnview As New ADODB.connection
Dim rsview As New ADODB.Recordset

    Call connection(cnview, App.Path & "\Seeyou.mdb", "endromida")
    'Call connection(cnview, "\\SEEYOU-PC\shared\Seeyou.mdb", "endromida")
    Call Recordset(rsview, cnview, "SELECT * FROM [order] where Edate = #" & txtEdate.Text & "#")

    If rsview.RecordCount = 0 Then
        MsgBox "No Record Found On Query.", vbCritical, "Seeyou"

    Else

        Set DayOrds.DataSource = rsview
        DayOrds.Orientation = rptOrientLandscape
        DayOrds.Show
    End If

End Sub

Error is : No Records Found
Even there are records in database, i am trying to filter data on base of Date
Is this Query is right?

Recommended Answers

All 2 Replies

  1. Rename your column name 'order' because ORDER is a reserve words/keyword in sql.
  2. Check your date format (Edate = #" & txtEdate.Text & "#")

@jhai_salvador: order is not here a column name . It is a table name. nothing happens because it is in square bracket.

check the field type of EDate and also if it is date type format the text properly.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.