Hello Guys, I hav a Code For My Report in Daily .I don't know why there is nothing show the records. even though the Error not Popup. This is My code guys. Help Me Guys

Dim rsReport1 As New ADODB.Recordset

rsReport1.Open "Select purchase_date, BarCode, Price,  ProductName, Quantity, TotalPrice From Dailyrecord where purchase_date = " & DTPicker1.Value & " ", acd, adOpenForwardOnly


If rsReport1.RecordCount > 0 Then

    Set DataReport2.DataSource = rsReport1
        With DataReport2
            .Sections("Section1").Controls("txtcode").DataField = "BarCode"
            .Sections("Section1").Controls("txtproduct").DataField = "ProductName"
            .Sections("Section1").Controls("txtqty").DataField = "Quantity"
            .Sections("Section1").Controls("txtprice").DataField = "Price"
            .Sections("Section1").Controls("txtsub").DataField = "TotalPrice"
            .Sections("Section1").Controls("txtdate").DataField = "purchase_date"
            .Show
        End With

End If

Recommended Answers

All 7 Replies

Change your select statement to -

rsReport1.Open "Select purchase_date, BarCode, Price,  ProductName, Quantity, TotalPrice From Dailyrecord where purchase_date = '" & DTPicker1.Value & "'", acd, adOpenStatic. adLockOptimistic

Hi,

Wrap date Column, with #

rsReport1.Open "Select purchase_date, BarCode, Price, ProductName, Quantity, TotalPrice From Dailyrecord where purchase_date = #" & DTPicker1.Value & "# ", acd, adOpenForwardOnly

Regards
Veena

First of all , sorry for disturbing , and now i am having some confusions regarding the following issue

very interesting topic arises here and that is

when to use adOpenStatic,adLockOptimistic and adOpenForwardOnly

in fact i've never used adOpenForwardOnly , so the question is when to use it ?

thanx in advance ?

The open methods is cursortypes...

Have a look at this link that explains all cursortypes, locktypes etc...

thanx for providing a meaning link that really explain about all possible values

once again thanx !

Only a pleasure. :)

Wonder what happened to our OP...

Thanks Guys.. Issue Solved ^_^

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.