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

HOW DO I CREATE A POP UP FORM THAT WILL CONTROL REPORT PARAMETERS

Status
Not open for further replies.

tweety1201

Technical User
Oct 16, 2001
5
US
I am trying to create a report based on a query. I have created a popup form for data input.

In the query I have specified the required criteria Between [Forms]![Calendar]![BeginningDate] AND [Forms]![Criteria]![EndingDate]. I have created a print preview button on the Form which contains the following code

Private Sub Preview_Click ( )
DoCmd.OpenReport "Report Name", acViewPreview, , "[BeginningDate] = '" & Me("BeginningDate") & "[Ending Date] = '" Me("EndingDate") & "'"

End Sub

I cannot get the code to run. What am I doing wrong?
Please help
 
Hi!

If EndingDate and BeginningDate are defined in the table as Date/Time then, in your code, substitute the # for the ' in your Where clause.

hth Jeff Bridgham
bridgham@purdue.edu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top