473,796 Members | 2,648 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Report/Sub Reports Where Clause Issue - Access 2000

13 New Member
I am using Access 2000 and have this setup.

Tables
Program
Procedure
WorkInstruction
Form

the tables are set up with the following relationships.

Procedure is a child of Program, where a Program can have one or many Procedures.
WorkInstruction is a child of Procedure, where a Procedurecan have one or many WorkInstruction s.
Formis a child of Procedure and WorkInstruction , where a Procedure and WorkInstruction can have one or many Forms.

If that doesnt make sense I can try to elaborate a bit more.

Anyways, Each one of these tables has a status column which will be a number between 1 and 8. I am trying to create a report that shows these tables in hierarchical form but only show statuses 1-5.

If I make a query each report is based on that says status between 1 and 5 it says "The specified field 'Status' could refer to more than one table listed in the FROM clause of your SQL statement."

I have tried putting Program.Status, Procedure.Statu s, etc and that did not work.

I think my Access skills are a bit rusty or this db is set up poorly, as I did not set it up. Anyways, this is waht the report should generally look like. Where the -'s are supposed to be spaces, in other words indented for make a hierarchical look.


Program1
-----Procedure1
----------WorkInstruction 1
-----Procedure2
----------WorkInstruction 2
----------Form1
-----Procedure3
----------WorkInstruction 3
---------------Form2

Hopefully that makes a bit of sense also. I just want to show all the procedures under a specific Program, all the work instructions under a specific procedure, etc but only show statuses 1 - 5

Thanks in advance.
Sep 26 '07 #1
2 1622
icenemesis
13 New Member
I think I may have figured out what the problem is. Since the database is setup a little wierd it may be causing the problem.

In the form table, it has two fields, one called procedureID, and workInstruction ID. This field can be null, but one or the otehr has to be filled in. If the procedureID is filled it it belongs to that procedure, if the workInstruction ID is filled in it belongs to that workInstruction .

Since a form can come under either of those, and there are two subreports that reference form as the source, it is giving this error.

Does that logic make sense? Am I correct in my reasoning?

Also, if that is the case, does anyone know of a work around.
Sep 26 '07 #2
nico5038
3,080 Recognized Expert Specialist
Looks to me that you have a straight forward 1:N relationship from top to bottom.
There's however one confusing thing for Access and that's a table named "Form". This is a reserved word and can cause trouble. Best to use for every table a prefix like:
tblProcedure, tblWorkInstruct ion, tblForm, etc.
That's the "safe" way.

Nic;o)
Oct 5 '07 #3

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

Similar topics

1
19187
by: Stephan | last post by:
Hi, I'm using Visual Studio 2003 (C#) with the integrated Crystal Report software and have the following question: How can I assign a value (string) to an unbound (string) field in Crystal Report at runtime? Example: private void button1_Click(object sender,
7
8381
by: Nothing | last post by:
I have a report based on a query that is based agaisnt two tables. The report pulls information for 1 customer. The tables may hold multipul customers. I want to email just the ONE report. All the options that I have found to email a report email multipul pages of the report, i.e. it sends all the information it can get fomr the query results. I am triggering the report via VBA off of a form. There is a button that
4
5378
by: sherkozmo | last post by:
SQL2000 - AccessXP I built an adp file with a stored procedure from SQL as follows: SELECT * FROM Z_mis_sjk_job_code_access WHERE job_code=@JobCode UNION ALL SELECT * FROM Z_mis_sjk_job_code_access_mkey WHERE job_code=@JobCode ORDER BY app_only, submenu_number, menu_routine_number,
3
3717
by: CSDunn | last post by:
Hello, I have a situation with MS Access 2000 in which I need to display report data in spreadsheet orientation (much like a datasheet view for a form). If you think of the report in terms of what a spreadsheet might show, the column names will actually be dynamic, based on data from a SQL Server 2000 database. The row data will also come from the same database. So in this case, I will have a main report and a subreport. I've already tried...
3
2903
by: RC | last post by:
I can't quite grasp the concept of creating custom reports depending upon what options a user picks on a Form. For example, the user clicks on a "Print Reports" button and a Form pops up. On the Form the user can choose to get a report that shows the Box Numbers that are at Warehouse A, Warehouse B or Warehouse C. and then click on the Print Preview button and get a report showing only the Box Numbers in whichever warehouse was...
1
1901
by: Chasing Gates | last post by:
I have created a database that brings in a new table weekly. I then made a separate query for each sales rep and a separate report for each rep. (The reports are all identical but call different queries.) Lastly, I created a macro that sends the reports to the respective rep via e-mail with the push of a button. I am pleased with myself for getting this far but I realize the next step is figure out how to use one report (so I don't...
6
3683
by: Bob Alston | last post by:
I am looking for Access reporting add-in that would be easy to use by end users. My key focus is on selection criteria. I am very happy with the Access report writer capabilities. As far as development of reports, it is certainly fine in my book. But for end-users, with little experience or training, it would be nice to have an easy way to handle various selection criteria, perhaps with relatively stock reports. I see easy to use by...
5
4621
by: sara | last post by:
I have reports that run from a form where the user can choose a date range, or they run automatically for a week in the "Weekly Reports" option. I created 2 queries and 2 reports - one query uses the WeekEndDate to filter, and its associated report heading says "For the week Ending " & forms!frmPrintReports.getWeekEndDate. The other query selects the date range using "Between" and the 2 dates on the form. Its associated report header...
15
3139
by: sara | last post by:
I am stuck. I have a report that I use in multiple places, so I call it with varying parameters (using the Where Clause in the code). I preview the report, send it to snap, then close the preview (the user can go to the server to see the snap view). Print, snap, then close is the only way I can snap with a Where clause. If there is No data that meets the criteria, I can cancel the print,
0
9685
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9535
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10465
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10242
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10200
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6800
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4127
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2931
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.