473,388 Members | 1,493 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,388 software developers and data experts.

Report Help

174 128KB
I need a report to pull data from 2 queries (qryProduction and qryAggregate. Ive started a report but only has data from qryProduction until I see how to combine the 2 queries. I need it to also to only show the data for the form that is open not all records. Thanks
Attached Files
File Type: zip Database.zip (303.1 KB, 53 views)
Apr 4 '19 #1

✓ answered by NeoPa

We'll deal with this quickly because that's a design request rather than a technical question and that's not really what we do here.

If you need data from multiple sources then you can build a query that incorporates both as sources and also (very importantly) defines the relationship between them. Your Report would then use this new query as RecordSource.

As for selecting just the current record there is a parameter called WhereCriteria of the procedure DoCmd.OpenReport() which allows you to specify filtering to be applied to the report when it's opened. Your code, presumably run from the Form, would set the filtering to include just the current record of the Form. Be careful of the FilterName parameter. This is something else and has been known to confuse not a few.

Another parameter, OpenArgs, is also available for you to pass into the Report anything else you may need. Not always needed for your task but is sometimes helpful.

NB. Please, as a general rule, only ever post your work if it's been requested. Far too many members seem to be of the opinion that :
  1. The experts here have nothing better to do than to spend their time in deep investigation of a problem which, in reality, is the responsibility of the poster to express clearly in the first place.
  2. Everyone is using the same version of Access so they have a system that will even open their work. Generally indicated by not even posting which version their database is stored in.

You can trust that if and when (because it does happen) any individual expert feels prepared to look into your actual database for you then they will be clear about requesting a copy.

12 1066
NeoPa
32,556 Expert Mod 16PB
We'll deal with this quickly because that's a design request rather than a technical question and that's not really what we do here.

If you need data from multiple sources then you can build a query that incorporates both as sources and also (very importantly) defines the relationship between them. Your Report would then use this new query as RecordSource.

As for selecting just the current record there is a parameter called WhereCriteria of the procedure DoCmd.OpenReport() which allows you to specify filtering to be applied to the report when it's opened. Your code, presumably run from the Form, would set the filtering to include just the current record of the Form. Be careful of the FilterName parameter. This is something else and has been known to confuse not a few.

Another parameter, OpenArgs, is also available for you to pass into the Report anything else you may need. Not always needed for your task but is sometimes helpful.

NB. Please, as a general rule, only ever post your work if it's been requested. Far too many members seem to be of the opinion that :
  1. The experts here have nothing better to do than to spend their time in deep investigation of a problem which, in reality, is the responsibility of the poster to express clearly in the first place.
  2. Everyone is using the same version of Access so they have a system that will even open their work. Generally indicated by not even posting which version their database is stored in.

You can trust that if and when (because it does happen) any individual expert feels prepared to look into your actual database for you then they will be clear about requesting a copy.
Apr 4 '19 #2
williamson1979
174 128KB
That's fine, its easier for me to see what everything is to have a conclusion but my line of work is different and often requires the big picture so its just habit.
Apr 4 '19 #3
williamson1979
174 128KB
NeoPa:
As for selecting just the current record there is a parameter called WhereCriteria of the procedure DoCmd.OpenReport() which allows you to specify filtering to be applied to the report when it's opened. Your code, presumably run from the Form, would set the filtering to include just the current record of the Form.
Currently the report opens from my form using a macro. I added DoCmd.OpenReport() to the where condition but it has {a explanation} an exclamation mark now.
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="UTF-16" standalone="no"?>
  2. <UserInterfaceMacros xmlns="http://schemas.microsoft.com/office/accessservices/2009/11/application"><UserInterfaceMacro For="Image432" Event="OnClick"><Statements><Action Collapsed="true" Name="OpenReport"><Argument Name="ReportName">rptPlantReport</Argument><Argument Name="WhereCondition">DoCmd.OpenReport()</Argument><Argument Name="WindowMode">Dialog</Argument></Action></Statements></UserInterfaceMacro></UserInterfaceMacros>
Apr 4 '19 #4
NeoPa
32,556 Expert Mod 16PB
I'm struggling. I've written clear details of everything you need to know about this, yet your response may as well be in another language. Believe me, I read everything I write a number of times before posting and make sure it makes good clear sense. Sometimes though, it seems obvious you don't understand what I'm talking about.

I talk about a parameter to a procedure that you call from code (VBA) and you respond after apparently attempting to include the name of the procedure as a parameter to some macro. I never recommend using macros BTW. They get you so far (not very) then you have to start over again with VBA as they're so limited and limiting.

So, where are we? We were never going to have a discussion in this thread anyway. It isn't a properly formed question. I went beyond the requirement to give you an outline of how to handle it. That's lucky because I wouldn't even now how to respond to your last post in any meaningful or helpful way.

Feel free to post another thread, with the same stipulations as before, but actually meet the requirements this time. With something specific I may be able to lead you step by step, but it sounds like your experience in Access is barely-existent so you will have to pay careful attention. If there's something you don't understand then query it but don't push on regardless and just guess. That hurts both of us.

As far as working with macros goes, if this is what you really feel you need, I may well not be able to help. I don't use them for the reasons stated above and I'm not even sure they can do what you want of them. I certainly neither know, nor wish to learn, how to take you forward in that direction.
Apr 4 '19 #5
williamson1979
174 128KB
I appreciate everyones help, so don't get me wrong because I do. But I can not explain what I do not know in the way you explain things to me. Far as my other post I was already using a macro so I looked for a where condition and entered what you suggested.
I never claimed I put what you suggested in the correct place and I also copied where I put it in case I had made a error. Its not easy to explain what you do not know. If I knew I would not be asking for help.

Again Thanks for any help that's been given. Its been helpful but with the change to add the subform it left the questions about the report and the subform Sum not working properly. I'm sure its something very simple I just don't know how to explain so there is little reason to post another thread about it.
Apr 4 '19 #6
williamson1979
174 128KB
So the last 2 threads are no good. Delete them please. If I can think of a better way to describe this issue I’ll try again to post.
Apr 4 '19 #7
NeoPa
32,556 Expert Mod 16PB
As I explained elsewhere I do appreciate how hard you're finding it to fit into how things need to be done here. I also can sense that you're trying to do things the way we ask, but that it's real struggle for you. I'm really not unsympathetic. The unfortunate truth though, is that we require them to be done that way because it works. Conversely, other ways simply don't. It's a real struggle for me to understand enough about what your describing the way you describe it. In this line of work a clear and full understanding is the only thing between a good & helpful answer, and one that would lead you into trouble.

As you find it hard to think at my level, I also find it hard to get where you're coming from. It may be a lack in me, but I'm frequently confused by your posts. I find nothing fundamental I can build upon, without which I have nowhere to start.

Let me say that in all of this, and I can imagine you must be experiencing at least as much frustration as we have here, your manners have always been exemplary. That's not a light thing to do - especially when experiencing frustration. So, you've impressed in one way at least.
Apr 5 '19 #8
williamson1979
174 128KB
I’ve tried to repost. I hope it is understandable and to point. It’s difficult because I don’t know what’s relevant or not. All I can do is try to post in a clearer and more focused way. Not sure it is but I tried to be to point.
Apr 5 '19 #9
williamson1979
174 128KB
I used this code after putting the main data in the report then added a subreport for the other data. So a little different than how I had started this thread but it works exactly as I need.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Image432_Click()
  2. DoCmd.RunCommand acCmdSaveRecord
  3. DoCmd.OpenReport "rptPlantReport", acViewPreview, , "[ProdID] = " & [ProdID]
  4. End Sub
Apr 5 '19 #10
NeoPa
32,556 Expert Mod 16PB
I hope it's a sign that you're starting to see some benefits from what we're trying to express. It's a steep learning-curve at this stage but it only gets shallower from here.
Apr 7 '19 #11
williamson1979
174 128KB
I'm starting to get a few things. Learning what level to address issues might take awhile. Some things I thought needed to be at the query were resolved at the report for example. I'm still having some issues overall but I believe things are starting to fall into place. I'll be asking a new question today lol... But let me get through the ones you've already addressed.
Apr 7 '19 #12
NeoPa
32,556 Expert Mod 16PB
That's good news. Learning is always at its hardest at the start.
Apr 7 '19 #13

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

Similar topics

4
by: Mike | last post by:
Hello All, I'm trying to deploy my windows-based application using crystal report. i package the setup by including the crystal report file, the exe file, and two merge modules for the crystal...
0
by: Tiago Miguel Silva | last post by:
I there. I´m almost desperate with a report that i´m doing! I am creating a report using the push method, being the data returned by a typed dataset. The report shows activities by week and...
1
by: Neil MacDonald | last post by:
Hi. Thanks in advance for your help. I have a database in which one report will not show the text from a memo field. If I run the underlying query, the field shows up in the table, with all...
1
by: steven | last post by:
I am creating some financial reports in Access 2000, and I am having problem that I can't resolve. The report sorts information first by vendor, then by budget line number. It generates the...
2
by: report help | last post by:
I have a report that is supposed to be two pages. The first page should contain the header, some data from a query, and the footer. The second page should contain the header, two subreports, and...
6
by: Takeadoe | last post by:
Dear NG - I'm very new to Access and reports are completely foreign to me. I was hoping that I could get some general guidance on how to proceed with the following: I've got a form (8.5x11")...
0
by: DhavalPatel1983 | last post by:
Hi All, I need ur help in Visual Baisc for Data Report. Description ========= I have one Project Which include One Data Envirnment,Data Report,Form Which contain Listview,Text box, and...
3
by: DeanL | last post by:
Hi guys, I'm in need of a little help with a report I'm setting up on Access 2000. The report shows data depending on entries on a form that has 7 fields (Min and Max Cost, Fiscal Year, Min and...
3
by: ranesmitas | last post by:
hello, i using vb 6 and i did report seagate crystal report . i want to know how it use in vb . i did some code but it not display anything code is Public strReportPath As String Public...
0
by: adsaca | last post by:
there basic sections in Crystal report namely Report Header Page Header Group Header Details
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.