URGENT : 2 separate Reports , please help. thks

  • Thread starter Thread starter hwzone
  • Start date Start date
H

hwzone

hi there, I am creating a project for my company, they want me t
generate two reports from a form,

my form has a field call 'permit no' , the report generated will be al
the permit nos scan in. e.g TT123656, TT126799, GG66562, GG66652 etc
They want two reports, i.e one report for TT... and another one fo
GG... , how can I do that ?

I include a preview button in the form , the code as shown below, wha
should I add in in order to get only the TT or GG report when I clic
on the button. I would be appreciate if someone can help me on this
Thanks


Private Sub CommandReport001_Click()
On Error GoTo Err_CommandReport001_Click

Dim stDocName As String

stDocName = "MUS_T"
DoCmd.OpenReport stDocName, acPreview


Exit_CommandReport001_Click:
Exit Sub

Err_CommandReport001_Click:
MsgBox Err.Description
Resume Exit_CommandReport001_Click

End Su
 
Hwzone,

I reckon the easiest way to do this is to open the Sorting and Grouping
dialog from the design view of the report, in the Field/Expression
column enter...
=Left([permit no],2)
.... and select Yes for the Group Header and Group Footer arguments.

Then, put all your report's existing Header information into this group
header. And set the Force New Page property of the group footer to
After Section.

Then, just print the report, and it will come out as if 2 separate
reports, one for the TTs and one for the GGs.
 
Back
Top