Form/Subform Prints Multiples of Records

  • Thread starter Thread starter JLJones13
  • Start date Start date
J

JLJones13

Hello All,

I have a Form/Subform which lists a Name on the Form and then other people
associated with that name on the subform.

Form Name: Doe, Jane

SubForm Names:
Doe, John
Kringle, Kris

When the user chooses to print or print preview, the printed format prints
all of the data once for each name present. In this case there are two
names, so it would print ALL of the data two times. If there are 30 names
on the subform, it will print all of the data 30 times (30 pages).

Does anyone have an idea as to why it is doing this?

TIA!
 
In general, printing the form doesn't work very well. It's best to create a
report that lays out the data for printing, and print that.

To print just the current record from your form, use the primary key value
to limit the report. Assuming the primary key is an AutoNumber named
"PersonID", the Click event procedure for a command button on your form
would be something like this:

Private Sub cmdPrint_Click()
Dim strWhere As String
If Me.Dirty Then
Me.Dirty = False
End If
If Me.NewRecord Then
MsgBox "Select a record to print."
Else
strWhere = "PersonID = " & Me.PersonID
DoCmd.OpenReport "MyReport", acViewPreview, , strWhere
End If
End Sub
 
Allen:

Thank you for your quick response and for the information.

I do have a report for this form, but I have also defaulted my menus and
toolbar to Access' "cut-down" version which includes the print preview and
print buttons and menu options.

Instead of changing my menus and toolbars, I thought someone may know why my
form insists on printing all data multiplied by the number of records
present and I could fix that. Right now I have 52 records on the sub-form
and that makes the printed version a total of 54 printed pages!

Thanks again!
 
Back
Top