Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forms Entry in Report

Status
Not open for further replies.

webdevop

MIS
Sep 18, 2003
11
US
I have a report that runs through a module and pulls data entries from temp tables. Here is the example:

Private Sub Preview_Customers_by_Month__Ship_Date__Click()
DoCmd.OpenReport &quot;customers by month (ship date)&quot;, acPreview, , &quot;[schd_date_start] <= [range].[to]&quot;
End Sub

I want to change the <= [range].[to] portion to readoff
of date field on a form equal to Form/Main/InpBegDate.

Can I change the code to reference the date box instead of the temp table within this code or on the report itself ?

Thanks for your time ...
 
Webdevop,
You can try:
Private Sub Preview_Customers_by_Month__Ship_Date__Click()
Dim strWhere as String
strWhere =&quot;[schd_date_start] <=#&quot; & Forms.Main.InpBegDate & &quot;#&quot;
DoCmd.OpenReport &quot;customers by month (ship date)&quot;, acPreview, , strWhere
End Sub

If this code is running in form Main then you can use:
strWhere =&quot;[schd_date_start] <=#&quot; & Me.InpBegDate & &quot;#&quot;


Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Nice Duane, I'll give that a shot ....

forgot to mention between InpBegDate and InpEndDate, what would be the back end on that code ??
 
strWhere would be
strWhere =&quot;[schd_date_start] Between #&quot; & Me.InpBegDate & &quot;# AND #&quot; & Me.inpEndDate & &quot;#&quot;

You also forgot to mention if the code is running on the form MAIN.


Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top