471,853 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,853 software developers and data experts.

How to use a search command in datareport

I am using VB6.0 and want to add a search command before generating the report just like we do in crystal reports.plz tell me how to do it in VB6.0,i dont have crystal report
Feb 21 '07 #1
2 1606

I'ved done that...
in coding....

Its ok to PM me... then i'll on this forum....

What is your database?

Feb 23 '07 #2

This code assumes that you know Data Report and Data Environment and SQL also.

Here is the sample code:

DE_DTR-name of Data Environment
SqlTran_PDay-name of SQL declared on DE_DTR
dtPic.Value -Date Picker

This is a snippets from my DTR System it displays data based from the given date.(dtPic.Value ).

NOTE:This will re-written your SQL on SqlTran_PDay in DE_DTR

Private Sub CmdDaily_Click()
If DE_DTR.Recordsets("SqlTran_PDay").State = adStateOpen Then DE_DTR.Recordsets("SqlTran_PDay").Close
DE_DTR.Commands("SqlTran_PDay").CommandText = _
"SELECT t.TransacID,t.EmpID, " & _
"t.TimeIN,t.TimeOut," & _
"t.Tran_Date,t.Remarks, " & _
"e.EmpID,e.Last_Name,e.First_Name,e.Middle,e.BCode ID " & _
"FROM TBL_Tran_DTR t " & _
"INNER JOIN TBL_EmployeeMaster e ON " & _
"t.EmpID = e.EmpID " & _
"WHERE t.Tran_Date =#" & dtPic.Value & "#"

DtaDaily.Show 'Displays the DataReport

End Sub

I wish i could help you better by emailing some sample program for this...

If you still have questions or any further question for this matter...
Feel free to asked.

Feb 23 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Sean Dodsworth | last post: by
3 posts views Thread by Yemi Alade via .NET 247 | last post: by
reply views Thread by YellowAndGreen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.