[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


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

Posted on 2011-10-04
Medium Priority
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
  • 4
  • 3
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 36912496
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
ID: 36912514
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

ID: 36912734
i need the report to display like this that is why- will try suggestion-
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 74

Accepted Solution

Jeffrey Coachman earned 2000 total points
ID: 36914722
<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

ID: 36915779
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

ID: 36915781
i'll post back - when i complete
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 36917972

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

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


Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

873 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