Getting Input Parameters from reports

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Anyone know how to get a list of input paramaters that a report may require? Is there a way to grab the query that builds the report. I've been trying to write a program in c#, but I am not too familure with the object model. Any help is greatly appreciated
Thanks
 
There is a way, but it is rather circuitous. Declare a DAO.QueryDef object (this may also work with ADO, but I haven't tried it that way). The one property associated with a DAO.QueryDef object is a Count property, which will you tell you the number of parameters that the query has. You can then loop through, retrieving the name of the parameter like so
namevariable = yourQDFObject.Parameters(Counter).Nam
increment the counter with each loop until you get to (total-1) since the numbering starts with 0
You also have to first create a DAO.Database object, set that to the current database, and use that object when you create your querydef object. Search in the VBE help for "QueryDef". Now how exactly you do this in C# I can't say.
 
Back
Top