How does ACCESS print the records currently displayed in the form?

Source: Internet
Author: User
Q: How do I print the currently displayed records in a continuous or single form? The current form also has a corresponding subform, which should be printed together. I have a single number in a form, and there are several groups of data in the big subform. My report is a set of data pages, how can I print a data report with only one click to print the current ticket number? Answer:

Q: How do I print the currently displayed records in a continuous or single form? The current form also has a corresponding subform, which should be printed together. I have a single number in a form, and there are several groups of data in the big subform. My report is a set of data pages, how can I print a data report with only one click to print the current ticket number? Answer:


Problem:

Continuous or single form,HowPrintCurrentDisplayOfRecord?CurrentThe form also has the corresponding child form, which must be togetherPrintCome out

I have a single number in a form. There are several groups of data in the big subform. My report is a set of data pages.HowClickPrint, Can onlyPrintCurrentWhat is the data report of the ticket number?

Answer:

This problem is too simple and I will not explain it separately. Please go to the "order" form "in the Rose Sample DatabasePrintCode for clicking an event in the invoice button



  
SubPrintWaybill _ Click ()
'This code is created by the "command Button wizard.
On Error GoTo Err_PrintInvoice_Click
  
Dim strDocName As String
StrDocName = "waybill"
'PrintUse the "invoice filtering" Report to queryPrintCurrentThe invoice for the order.
DoCmd. OpenReport strDocName, acViewNormal, "waybill filtering"
  
Exit_PrintInvoice_Click:
Exit Sub
  
Err_PrintInvoice_Click:
'If the user cancels the operation, noDisplayError message.
Const conerrdow.cancelled = 2501
If (Err = conerrdow.cancelled) Then
Resume Exit_PrintInvoice_Click
Else
MsgBox Err. Description
Resume Exit_PrintInvoice_Click
End If
  
End Sub

Here, the DoCmd. OpenReport strDocName, acViewNormal, "waybill filter" parameter of "waybill filter" is a query name. The query code is as follows:

SELECT invoice .*

FROM invoice

WHERE (invoice. Order ID) = Forms! Order! Order ID ));

Refer to the OpenReport syntax.

Author: Unknown

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.