Report question

  • Thread starter Thread starter Bob Parr
  • Start date Start date
B

Bob Parr

How can I get custom data to a report. That is I need to create or modify a
query then run a report on that data. Can I modify existing querys, or call
the report and send it a table that I just built. I think I can create a
query def, but how do I delete it when I am done or before I rebuild it.
Also it would be best if I could step through a table one record at a time
and decide to print it or not then print one record at a time. How can I do
any of this?

Bob
 
Bob said:
How can I get custom data to a report. That is I need to create or modify a
query then run a report on that data. Can I modify existing querys, or call
the report and send it a table that I just built. I think I can create a
query def, but how do I delete it when I am done or before I rebuild it.
Also it would be best if I could step through a table one record at a time
and decide to print it or not then print one record at a time. How can I do
any of this?


I don't know why you feel you need to create a table for a
report. Access has a high degree of flexibility in
filtering a report's record source query. Not to mention
that SQL is pretty flexible in selecting the data for a
report. But, to answer your question, your can delete a
query by using QueryDefs.Delete "queryname".

As for stepping through the records in a report's record
source table/query one at a time, No, that is not a reliable
way to do things. Reports do not guarantee to process their
records in a sequential fashion, there is just too much
going on what with Grouping, KeepTogether,
CanGrow/CanShrink, etc. for a simple record at a time kind
of logic to deal with.

However, If you can make the decision to keep or skip a
record based solely on the information contained in the
record, then Yes, you can do that by cancel ling the Format
event. BUT, almost all the time, that decision could have
been made far more efficiently in the record source query or
the OpenReport's WhereCondition argument.
 
Back
Top