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

Report Date Range with Name Selection

Status
Not open for further replies.

webvine

Technical User
Oct 21, 2002
20
Hi,
I am using the Report Date Range form to open up a report by date. (This is the standard Report Date Range form that can be found in the various database that come with Access 2000). This feature is great but is there a way that on that Report Date Range form I can add another unbound text box or combo box which I can select a persons name? Such as pulling up all the records in a report by a specific date and specific person.
Thanks in advance for any help.
Webvine
 
There are several ways to do it. The easiest way to do it is to utilize the Where argument of the OpenReport Method (Example 1). You could also filter your report based on the values on the form. Do this in the OnOpen event of the report (Example 2).

Example 1:

Docmd.OpenReport "YourReport",,,"(yourdate...)"

Example 2:

Me.Filter = "(YourDate Between #" & Forms!YourForm!dteBegin & "# AND #" & Forms!YourForm!dteEnd & "#) AND (PersonsName = '" & Forms!YourForm!txtBoxPersonsName & "')"
Me.FilterOn = True

The syntax in both examples would be the same.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top