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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Move ActiveXCtl Value from a Calendar to a Report

Status
Not open for further replies.

novice24

Technical User
Jun 20, 2001
17
0
0
US
Help,

I have a Calendar form (with 2 Calendars) that allows the user to pick 2 dates (StartDate/EndDate). These values are used in a Query to select records. All of this works fine. HOWEVER, when I attempt to move the (StartDate and EndDate) to a report along with the results of the Query, I loose them. The Query results show up fine, but because I close the Calendar form before bringing up the Report on the Screen, it seems to be loosing the (StartDate and EndDate). Please be aware that I have to close the Calendar form because I have it set as a "Pop-up" and need to keep it that way.

How do I grab the Values of the StartDate and EndDate and establish them as a Global string or something before I close the Calendar Form so that they are independent of the Calendar form and are available for incorporation into my Report.

Thanks in advance for any advice

 
docmd.openreport "MyReport"
reports!MyReport.filter= "DateField =#" & _
me.StartDate & "# And DateField =#" & _
me.EndDate & "#"
reports!MyReport.filteron=true
docmd.close acform,"MyFormName"


Also you can create SQL for your report:
reports!MyReport.recordsource="Select * from MyTable Where "DateField =#" & _
me.StartDate & "# And DateField =#" & _
me.EndDate & "#;"

docmd.close acform,"MyFormName"


Aivars


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top