Question on Group Header Event

R

Ruth

I am printing a report based on a query that omits certain
records. I have one group header. I am using the code
builder for the group header event to increment a
sequential number. Every time I print the report, the
number printed for the first header is actually 5 more
than it should be. After the first number is printed, the
rest of the numbers print sequentially as expected.

Any ideas? The underlying query grouping looks right.

Thank you!
 
D

Duane Hookom

If you are running code, you need to provide:
1) what is the code supposed to do
2) provide your code
3) provide a description of what is actually happening.
 
G

Guest

The code in my report is:
Private Sub GroupHeader0_Format(Cancel As Integer,
FormatCount As Integer)
DoCmd.RunMacro "[Get LastPO # during report execution]"
End Sub

The macro code runs a query to get the last number from
the system file, add 1 to it, update the system file
with the new number and set the value of my
po # field for the report.

The numbers increment correctly and the last number stored
in the system record is correct.
 
D

Duane Hookom

I would run code prior to reporting that would update or increment the PO#.
Then run your report with the numbers already in there. I keep reports to
display values, not update them.

--
Duane Hookom
MS Access MVP


The code in my report is:
Private Sub GroupHeader0_Format(Cancel As Integer,
FormatCount As Integer)
DoCmd.RunMacro "[Get LastPO # during report execution]"
End Sub

The macro code runs a query to get the last number from
the system file, add 1 to it, update the system file
with the new number and set the value of my
po # field for the report.

The numbers increment correctly and the last number stored
in the system record is correct.





-----Original Message-----
I am printing a report based on a query that omits certain
records. I have one group header. I am using the code
builder for the group header event to increment a
sequential number. Every time I print the report, the
number printed for the first header is actually 5 more
than it should be. After the first number is printed, the
rest of the numbers print sequentially as expected.

Any ideas? The underlying query grouping looks right.

Thank you!
.
 

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