Print date from form into report

  • Thread starter Thread starter Anna
  • Start date Start date
A

Anna

How to print the two dates in report which i input from the form.

Private Sub cmd_prntrpt_Click()
DoCmd.OpenReport "rpt_qrywebmail2", acViewPreview
end sub

Query
SELECT WM.CRC, Sum(WM.WM_Amt) AS Totamnt
FROM tbl_WebMail AS WM
WHERE (((WM.WM_Date) Between [Forms]![frmWeb_Mailfilter]![txtdate1] And
[Forms]![frmWeb_Mailfilter]![txtdate2])) OR
((([Forms]![frmWeb_Mailfilter]![txtdate1]) Is Null)) OR
((([Forms]![frmWeb_Mailfilter]![txtdate2]) Is Null))
GROUP BY WM.CRC
HAVING (((WM.CRC)=[Forms]![frmWeb_Mailfilter]![ddlcrc])) OR
((([Forms]![frmWeb_Mailfilter]![ddlcrc]) Is Null));

Thank You.
 
Make the control source of the text box you want to print the date in
Forms!NameOfForm!NameOfControl

The form will have to remain open while the report is be created for this to
work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top