How Access prints the records currently displayed in the form

Source: Internet
Author: User
Tags query rar
access| Print | show question:

How do you print a record that is currently displayed, continuous or a single form? The current form also has the corresponding subform, and also prints it together
I have a single number in a form, large subform has several sets of data, my report is a group of data page, how to achieve a click to print, can only print the current number of data reports?

Reply:

This question is too simple, I do not have another explanation, please go to the Northwind sample database, "Print the Invoice" button on the order form click the event code

Http://access911.net/down/eg/northwind2003.rar
Http://access911.net/down/eg/northwind97.rar

Sub Print shipping list _click ()
' This code is created by the Command Button Wizard.
On Error GoTo Err_printinvoice_click

Dim strDocName as String

strDocName = "Shipping List"
' Print the Invoice report and use the Invoice filter query to print the invoice for the current order.
DoCmd.OpenReport strDocName, acViewNormal, "Shipping slip filter"

Exit_printinvoice_click:
Exit Sub

Err_printinvoice_click:
' If the user cancels the operation, no error message is displayed.
Const conerrdocmdcancelled = 2501
If (ERR = conerrdocmdcancelled) Then
Resume Exit_printinvoice_click
Else
MsgBox Err.Description
Resume Exit_printinvoice_click
End If

End Sub

Here's DoCmd.OpenReport strDocName, acViewNormal, the invoice filter argument for the invoice filter is the name of a query that looks like this:

SELECT the shipping list. *
From the issuing manifest
WHERE ((Invoice. Order ID) =forms! order! Order ID);

Please refer to OpenReport's syntax, which is available in ACCESS help.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.