A standard module, in Access terms, is a module that is not a "class module"
(the modules associated with Forms and Reports are, officially, "class
modules"). The newsgroup is not appropriate for trying to teach details of
programming to a novice, so just let me tell you how to do it. BTW, all
these instructions apply to Access 2003 or earlier... if you are using
Access 2007, you need someone else to describe how to navigate to the
functionality I describe:
(1) On the Database Window, click Modules, then Choose
"New". That will open up a module Window with a new
Standard Module, in which you can code
Dim lngPgNo as Long
Then Save and Close that Window, by clicking the little
red X in the upper right-hand corner. Because the lngPgNo
variable is defined in a standard module, it will be visible to
code in any other module, either standard or class module.
(2) In the Property Sheet for the Group Footer (if it is not
visible in Design View, right-click the Group Footer, and
choose Properties), click the Events Tab, click the line for
the Print Event, click the box with the three dots, and in
the resulting dialog, choose "Code Builder". In the module
that is opened, the cursor will be positioned between a
"Private Sub " statement and an "End Sub" statement, and
you should type:
lngPgNo = Page
Then you can click the red X in the upper right hand corner
to close the module window.
(3) Follow the same steps to open the module window for
the Page Footer, and in that module, type:
If lngPgNo = Page Then
Me.txtFooterSubtotal = False
Else
Me.txtFooterSubtotal = True
End If
Close the module window.
That should do what you want. However, before, you wrote about two text
boxes one telling the user to enter the subtotal and the other empty for the
user to write the data -- you may have mis-described a Text Box and its
associated Label. In any case, if one of the boxes is still visible,
please just add it to the code above in both the first and second
sections -- no need to report back here that one of the items is still
visible.
Frankly, I generally do not write detailed step-by-step VBA code solutions
in newsgroups for users at a level where they have no idea how to get to the
point of entering code. I am not sure what gave me the idea that you were
at a level of knowledge where giving you the code would be enough. I caution
that I have not yet expended the time and effort to create a sample (which
might or might not be close enough to what you are working with to even be
meaningful) and try this, so there may yet be problems.
If it does not work, I invite one of my colleagues to step in and follow
through, because I have exceeded the time and energy that I can allocate for
answering a simple newsgroup question.
Larry Linson
Microsoft Office Access MVP