MoveLayout,NextRecord

C

Craig Hornish

I am using the feature of NextRecord, PrintSection, and MoveLayout to
print out a report with no Recordsource and I do this in the Print Detail
Section.. It works fine for one of the reports I am using that has only one
group heading.
Now I would like to stop at a certain point during that process in the
Print detail line and print out a group header and then come back to
printing the detail lines.

Please only respond to the group if you know how to do this, so more
people will be inclined to look at this post.
Guesses can will gladly be received at chornish <AT> cap-associates
<DOT> com.

Thank you

Craig Hornish
 
M

Marshall Barton

Craig said:
I am using the feature of NextRecord, PrintSection, and MoveLayout to
print out a report with no Recordsource and I do this in the Print Detail
Section.. It works fine for one of the reports I am using that has only one
group heading.
Now I would like to stop at a certain point during that process in the
Print detail line and print out a group header and then come back to
printing the detail lines.

Please only respond to the group if you know how to do this, so more
people will be inclined to look at this post.
Guesses can will gladly be received at chornish <AT> cap-associates
<DOT> com.


I don't know if anyone knows how to do that, but I will take
a "guess" at some workarounds ;-)

An entry in Sorting and Grouping can only consist of fields
in the report's record source table/query and literal
values. Therefore, since you have an unbound report, you
can only group on a literal constant, which means there can
only be one group. I assume that you have gotten this far
and that this is what prompted your question.

What I have done in this kind of scenario is bind the report
to a simple table with just a few records that either
contain the group identifier or just a sequence of numbers
(1, 2, . . ., N). In the latter case the record source
query would just be:
SELECT Num FROM Numbers WHERE Num <= {NoOfGroups}
Then set the report to group on the Num field. FWIW, I call
this kind of report "lightly bound".

Now, when you decide you have finished with a group's
details, you do not set Me.NextRecord = False, the report
will be able to go on to the next record in the record
source table/query. Use a hidden text box bound to the Num
field in the group header so your code can figure out which
set of values you want to plug into the group header
controls and the group's detail controls.

A different alternative is to continue on in the detail
section making controls visible or not as you need to
simulate a group header or detail.

A third alternative is a lot messier. Skip using controls
altogether and just use the CurrentX/Y properties and the
Print method.
 
C

Craig Hornish

Hi,
Thanks for the responce I had thought of your first idea after I had
written my second post
on the same day. The only issue I found was knowing how many groups I would
need. I don't
want to run the query twice (one for just the count of groups) to find that
information. Fortunatly
I know there will be a limited amount of groupings (Will have the table with
10 numbers) and
just use the MoveLayout = False and Print Section = False so the extra
grouping don't print.

Thanks again for your input.

Craig Hornish
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top