473,385 Members | 1,531 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

I have a report that selects/filters records from field 'a' I want to change that to

I have a current report that displays all cars in a selected state. I would like to change the report to show all 'Ford's' in the database independent of the state. I look at the report view but I do not see where to change the filter.
Jul 1 '18 #1
5 1212
twinnyfo
3,653 Expert Mod 2GB
Reports are filtered external to the Report (although it is possible to filter a report using it’s VBA module).

However, typically, when you want to change the records displayed on a report, you change its record source (the query that generates the records).

We are glad to help you with this, but we will need a little more information on how your DB is structured and what your current report/record source is like. How is your report generated and how does your DB determine which state the cars are from? There may be ways to generate the record source programmatically so that you have a main form that selects which criteria to select/filter for your report.

Standing by to hepp.....
Jul 1 '18 #2
NeoPa
32,556 Expert Mod 16PB
TwinnyFo:
However, typically, when you want to change the records displayed on a report, you change its record source (the query that generates the records).
I can't say I agree with that.

Typically, unless you want to generate extra work for yourself, you'd change the .Filter and .FilterOn properties of the Report itself. That's always simplest. Changing .RecordSource is often simple enough, but often isn't too. It's never simpler than setting the .Filter and .FilterOn properties.
Jul 2 '18 #3
PhilOfWalton
1,430 Expert 1GB
I suspect it may be a little more complicate.
In the first case, I would expect a group header for the States, listed alphabetically, and the makes of cars & details listed under that.
In the second case, I would expect a Car Make as the group header and the states listed under that.

As Twinnyfo says, until we see his relationship and exactly what his report looks like, we can go no further.

Phil
Jul 2 '18 #4
twinnyfo
3,653 Expert Mod 2GB
@NeoPa,

Perhaps I mis-spoke, or more likely, I was unclear. When I mentioned changing the record source, what I meant was not changing the .RecordSource prorerty, but rather the query itself.

For example, the report rptCars may have the .RecordSource qryCars. My intent was not to change the record source to qryCarsByMake, but rather to change the Query Def qryCars to reflect the needs of the user. This could be done by creating/saving that query def programatically, and opening the report.

However, I do see advantages of having a generic query qryCars assigned to the Report, and filtering the report porgramatically when it is opened.

This method would definitely work with a one-size-fits-all report. However, I would think that a report designed around cars by state would be formatted differently (even if just slightly) from a report designed around cars by make. Perhaps this is why most of my reports do not use filters, as many of them are very specifically formatted--the queries behind them are very complex queries with sub-queries and sub-sub-queries and many complex calculations made along the way (maybe this is a bad design) and filtering is done at the earliest levels, so that rather than making calculations on 20,000 records, I am making calculations on 1,000 at the most.

If this report is simply a list of cars, one could easily assign a report title to the report and list the cars at teh form-level.

Again, we need more information to provide a concrete solution to the OP's question.
Jul 2 '18 #5
NeoPa
32,556 Expert Mod 16PB
TwinnyFo:
However, I do see advantages of having a generic query qryCars assigned to the Report, and filtering the report porgramatically when it is opened.
Bingo. This is strongly preferable in most cases. SQL optimisation will typically catch lower-level filtering anyway so never assume that just because it's filtered at a higher level it won't be handled optimally by the SQL engine. Even Jet/ACE can manage this in most cases.

It is possible that the Report would also need to be tweaked, but in this case there is no mention of that as yet.

As a general rule the filtering approach makes much more sense. It keeps it simple, and you never want QueryDefs around the place where you don't know exactly what they do.
Jul 2 '18 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: enio | last post by:
Hi, I intend to get some answer from postgres concerning if an update command has altered some records in the database. To do this I coded this function: create or replace function...
8
by: John Baker | last post by:
Hi: Access 2000 W98! I have a table with numerous records in it, and am attempting to delete certain records that have been selected from it. These are selected based on the ID number in a...
5
by: Greg Teets | last post by:
I am running an Access report from VB via ADO. The report has a field that shows the date it was run. How can I return the data from this field to VB or have Access post it to a table when the...
15
by: shaqattack1992-newsgroups | last post by:
Hello Everyone, Let me explain my problem. I have included 2 dashes between each pair of records to make it easier to see what goes together. In reality, it is just a long list of results...
0
by: willemp | last post by:
i have a report with a 3 groups in it A - project B - person each record in the report consists of a single realised workday on a single project by a single person.
2
by: rtwPhoenix | last post by:
Does anyone know a way in CR to select only the records they want via a parameter? I thought this was like a WHERE but it doen't work that way it staill gets all the records just the starting point...
3
by: Redbeard | last post by:
Hi All this is my first time post, be gentle. I am looking at creating a keyword search that searches multiple fields in a Form and then filters records that match the keyword. The Form...
1
by: Doug | last post by:
What is the simplest way to make a report where only the records where a field matches a certain date are included, and the user first selects that date (from form or popup)? (I can write the SQL...
10
by: sunsom | last post by:
i want to change the display field to a drop down when a check box is clicked.
0
by: munkee | last post by:
Hi all, This would normally be quite simple however for some reason I can not getting working. My code to open my report filtered to a primary key is as follows: Case "Full record"...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.