|
-
May 21st, 2007, 08:08 AM
#1
Thread Starter
Junior Member
Data Reports question
Hi. I am trying to produce some reports in the Data Report in VB6. What i need to do is this,
I have 2 text boxes on my form (txtDate1.Text and txtDate2.text) and a Command Button. i want to enter a start date and End date, and a Report will be printed out with the data that falls into that criteria. I have only just found out about Data Reports and am very new to them. Before i was using a PictureBox on the form and the code was working, but the only code i know for Data Reports so far is DataReport.Show , and Orientation for printing. anybody help me with this please.
Code:
sqlReport = "SELECT * FROM ClientsYearQuery WHERE (((ClientsYearQuery.DateRecorded) BETWEEN #" _
& txtDate1.Text & "# AND #" & txtDate2.Text & "#))"
-
May 21st, 2007, 12:07 PM
#2
Re: Data Reports question
Hi,
There was a thread I posted about dates as parameters...I don't know if it was resolved or not but i think the idea was there...You can actually embed the SQL code in a command button or in the data environment where you created made your data report..
Greg
-
May 21st, 2007, 12:25 PM
#3
Thread Starter
Junior Member
Re: Data Reports question
I have already tried inputting the SQL into the the command button on the Data Environment, but it did not bring out any table name.
I have got the table names by inserting
Code:
Select * FROM ClientsBailGrantedQuery
and got it to Printpreview but just cannot get the date textboxes on the form to work
-
May 21st, 2007, 12:29 PM
#4
Re: Data Reports question
Hi,
Theres no criteria in your sql query like select * from table1 where fieldname = 'criteria'...
Have you tried checking the parameters in your data environment? Setting values in data environment is a tedious job...
greg
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|