CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2000
    Location
    NC, USA
    Posts
    56

    parameters for a report

    I am trying to create a data report in a data environment, but I cannot seem to figure out how to get the parameters for the report. I am creating a report based off three tables that require the data for the past tweleve months. I need to get the month and year that the user is reporting on then base that on what dates I need for my where statements.
    Could someone please help??


  2. #2
    Join Date
    Mar 2000
    Posts
    2

    Re: parameters for a report

    Try the following:

    modify the commandtext property of the command object at runtime

    eg
    Dataenvironment is dataenvironment1
    connection is connection1
    command is command1

    try the following code

    dataenvironment1.commands("command1").commandtext = strsql
    dataenvironment1.rscommand1.open

    where rscommand1 is the recordset object of the command and
    strsql = the SQL statement containing the parameters

    eg Strsql = "select * from categories where categoryID = " & text1.text & "


    Hope this will solve your problem
    Regards,


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

Featured