469,127 Members | 1,262 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,127 developers. It's quick & easy.

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 1577

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
1 post views Thread by CARIGAR | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.