Printing Records through Forms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table whose records I want to print through a form. The information
I want printed is contained totally in the Detail section of the form. When I
printed the first record, I got the Detail section along with 4 other blank
pages. I had apparently also printed the 2 sections (Page and Form) for both
the Header and Footer sections of the form - even though they don't contain
any information. This does not happen with other forms I print with. Is
there some way to "turn off" these other 4 sections so that they don't print?
 
Forms are for viewing, adding, and editing data. Reports are for printing.

Build a report and then add a button to your form. Have the button print
the report for the current records. Your code would look something like the
following code I use in one of my employee databases...


Private Sub Print_Button_Click()

If (IsNull([UserID])) Then

' Verify the key field (UserID) has a selection

Exit Sub

End If

DoCmd.OpenReport "SomeReportName", acViewNormal, "","[UserID] =
Forms![frmSomeFormName]![UserID]"

End Sub








Rick Bear


ndunwoodie said:
I have a table whose records I want to print through a form. The information
I want printed is contained totally in the Detail section of the form. When I
printed the first record, I got the Detail section along with 4 other blank
pages. I had apparently also printed the 2 sections (Page and Form) for both
the Header and Footer sections of the form - even though they don't contain
any information. This does not happen with other forms I print with. Is
there some way to "turn off" these other 4 sections so that they don't
print?
 
Unfortunately, your suggestion does not solve my problem. Even if I use a
report instead, I'm still getting blank pages - as though it's also printing
the headers and footers. How can I get rid of those so they don't print?

Rick B said:
Forms are for viewing, adding, and editing data. Reports are for printing.

Build a report and then add a button to your form. Have the button print
the report for the current records. Your code would look something like the
following code I use in one of my employee databases...


Private Sub Print_Button_Click()

If (IsNull([UserID])) Then

' Verify the key field (UserID) has a selection

Exit Sub

End If

DoCmd.OpenReport "SomeReportName", acViewNormal, "","[UserID] =
Forms![frmSomeFormName]![UserID]"

End Sub








Rick Bear


ndunwoodie said:
I have a table whose records I want to print through a form. The information
I want printed is contained totally in the Detail section of the form. When I
printed the first record, I got the Detail section along with 4 other blank
pages. I had apparently also printed the 2 sections (Page and Form) for both
the Header and Footer sections of the form - even though they don't contain
any information. This does not happen with other forms I print with. Is
there some way to "turn off" these other 4 sections so that they don't
print?
 
In my experience, blank pages printing is related to the width of your
report detail section and the page settings for your print job combined with
the margins.

See what your print setting page size (minus margins) is and compare that to
the width of your detail section in design-view. My bet is that your report
is too wide to fit on the defined page. You need to shrink your report, or
increase your margins.

Rick B


ndunwoodie said:
Unfortunately, your suggestion does not solve my problem. Even if I use a
report instead, I'm still getting blank pages - as though it's also printing
the headers and footers. How can I get rid of those so they don't print?

Rick B said:
Forms are for viewing, adding, and editing data. Reports are for printing.

Build a report and then add a button to your form. Have the button print
the report for the current records. Your code would look something like the
following code I use in one of my employee databases...


Private Sub Print_Button_Click()

If (IsNull([UserID])) Then

' Verify the key field (UserID) has a selection

Exit Sub

End If

DoCmd.OpenReport "SomeReportName", acViewNormal, "","[UserID] =
Forms![frmSomeFormName]![UserID]"

End Sub








Rick Bear


ndunwoodie said:
I have a table whose records I want to print through a form. The information
I want printed is contained totally in the Detail section of the form. When I
printed the first record, I got the Detail section along with 4 other blank
pages. I had apparently also printed the 2 sections (Page and Form)
for
both
the Header and Footer sections of the form - even though they don't contain
any information. This does not happen with other forms I print with. Is
there some way to "turn off" these other 4 sections so that they don't
print?
 
Back
Top