Dear List,
I used the following codes. But data cann't be accessed by the Reports.
It's generating the full table report (from Stock table). But I just want
to print
data filtering the from Text box item value.
How can I do using DAO?
Option explicit
Dim Db1 as database
Dim m_Report As New CrystalReport1
Dim adoRs As ADODB.Recordset
private sub Form_Load()
Set Db1 = OpenDatabase(App.Path & "\STOCK.mdb")
Dim SQL As String
Text1.Text = "1003"
SQL = "select * from ItemInfo where ItemCode = '" & Text1.Text & "'"
Set adoRs = CreateObject("adodb.recordset")
adoRs.Open SQL, "database=Stock.mdb;uid=;pwd=;dsn=stock",
adOpenKeyset, adLockBatchOptimistic
m_Report.Database.SetDataSource adoRs
CRViewer1.ReportSource = m_Report
CRViewer1.ViewReport
End sub
Please help.