Results 1 to 4 of 4

Thread: Data Reports question

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2006
    Posts
    19

    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 & "#))"

  2. #2
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    2,024

    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
    CodeBank: VB.NET & C#.NET | ASP.NET
    Programming: C# | VB.NET
    Blogs: Personal | Programming
    Projects: GitHub | jsFiddle
    ___________________________________________________________________________________

    Rating someone's post is a way of saying Thanks...

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Oct 2006
    Posts
    19

    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

  4. #4
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    2,024

    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
    CodeBank: VB.NET & C#.NET | ASP.NET
    Programming: C# | VB.NET
    Blogs: Personal | Programming
    Projects: GitHub | jsFiddle
    ___________________________________________________________________________________

    Rating someone's post is a way of saying Thanks...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width