detecting Reports with parameters

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

Guest

Hi
I am writing a program that will print out all reports in an mdb. I am currently using automation to do so. Some reports require paramaters, and display a dialog box, thus halting my automation. Is there a way that I can determine wether or not a report requires any parameters so I can ignore those reports. I am happy to use automation, oledb, dao, anything
Thanks
Jean Claude
 
Access treats as a parameter any name that does not match a field, whether
declared as a parameter or not.

Starting with the report's RecordSource, determine whether this is a table,
query, or SQL statement:
- Table: no parameters at source level.
- Query: Loop though the Parameters collection of the QueryDef.
- SQL statement: create a temporary querydef.

Can we assume that the report itself does not have non-existent fields named
in:
- ControlSource of controls;
- Sorting and Grouping;
- Filter or OrderBy;
- LinkMasterFields of subreports, etc.
To handle those as well, you would need to create an array of the
recognisable names parsed from the FROM clause, allowing for aliases. Then
you need to handle expressions which correctly represent any combination of
fields and/or literals and/or references such as Forms!MyForm!MyTextbox
which would be treated as parameters if the form is not open.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Jean Claude said:
I am writing a program that will print out all reports in an mdb. I am
currently using automation to do so. Some reports require paramaters, and
display a dialog box, thus halting my automation. Is there a way that I can
determine wether or not a report requires any parameters so I can ignore
those reports. I am happy to use automation, oledb, dao, anything.
 
Back
Top