add ability to search name field in query- before displaying records

Posted on 2011-10-04
Last Modified: 2012-05-12
hello - am attaching database
when database opens - a form comes up
if you select the date 8/22 in 'from' box
and 8/25 in 'to' box
Then click print button- you will see it displays records for those dates.

I want to be able to create a report also that first asks to enter a name- and only displays records with that name
is this possible?
[names are jones and thomas]
thank you
Question by:davetough
    LVL 74

    Expert Comment

    by:Jeffrey Coachman
    whats the need to create a temp table? (and all the associated code)

    A basic report filter could look something like this:
    DoCmd.OpenReport "repweekly", acViewReport, , "SomeDateField=" & "#" & txtDate & "#" & " And " & "SomeNameField=" & "'" & Me.cboName & "'"

    This is really all you need to open a report with a filters from a form

    LVL 74

    Expert Comment

    by:Jeffrey Coachman
    sorry.... More info

    So basically you would add a combobox or textbox for the Name, then just open the report based on the form selections...

    Author Comment

    i need the report to display like this that is why- will try suggestion-
    LVL 74

    Accepted Solution

    <i need the report to display like this that is why>
    My question was about all the other code.
    Creating temp tables and using recordsets has nothing to do with how the report "Displays", it justs creates/manipulates the underlying data.
    I was just curious as to why all of that is needed.

    I was just wondering why you could not simply create the Report from a simple table or query, and open the form with the filters as I demonstrated...

    Keep me posted.


    Author Comment

    you may be right- i was having trouble- i wanted this to display - instead of vertical- more like a cross tab query- then I realized - excel did better job- but then I went back to access- because- I need to just make buttons that people can use- and exporting it to excel seems to be more involved-
    but now i am wondering if  i can create this report without having a temp table and be this involved like you said-
    maybe i am making more complicated than needs to be
    thank you

    Author Closing Comment

    i'll post back - when i complete
    LVL 74

    Expert Comment

    by:Jeffrey Coachman

    In Access you can create a Pivot table in some cases.

    Finally (if your feeling froggy) you can create a "Dynamic Crosstab Report"


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
    In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
    Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
    In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now