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.
 
Back
Top