Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2004
    Location
    Toronto, Ontario, Canada area
    Posts
    4

    Question Unanswered: Need help using parameters with VB6 data reports

    I am using data reports in VB6 to connect to a local Access database. My forms use DAO to manipulate the data; I am using ADO only for the data reports. I have established a data environment with a whole bunch of commands, all of them with the SQL statements entered in them (no stored procedures), some of which have parameters. When I run the parameterised commands, I get a dialog box asking for the parameter values which I enter and it works fine.

    I need to know how to set the parameters from within my VB code. I want to be able to view the report based on values selected on a form (show only records for a given supplier, product line, customer, etc.) I want to be able to feed these values to the report before calling Show or PrintReport. I have it working fine when I do not have any parameters in the query, but I have yet to be able to set the parameters for the command.

    I also need to be able to change which command I am using at run-time to get a different set of parameters. All the fields are identical between these related commands. It is just a matter of which fields the user selects. I think I have this working, but can not test it properly, not being able to set the parameters.

    Any help, especially a code example, would be greatly appreciated.

  2. #2
    Join Date
    Jul 2004
    Location
    Toronto, Ontario, Canada area
    Posts
    4

    Progress Update

    Ok, What I have done so far:
    I have used the DAO to create dump the desired information into a new table, that contains the fields needed for the datareport. I then directed the command used by the data report to the new table. It displays the first report without any difficulty. Now my problem is that when I change the data in the recordset and call the data report again, it does not re-read the data table. Any ideas on how to force this?

Posting Permissions

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