473,406 Members | 2,371 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,406 software developers and data experts.

Problems with a Report from a Query

Hi, this is my first post on this site, so my apologies if I have done this wrong. I'll also apologise for my spelling as I'm dyslexic.

I'm having a problem with a Report from my database. I have 'Project Basic', 'Project Details' and 'Design Versions' tables and they are linked by the 'Project Reference Number'. I want to produce a report using data from all three tables, ordered by Project, so I used a query to gather the data (see the sql below), then based the report on the query. I have three entrees in the tables but the report will only work with one of the records and not with the other entries.

I'm using Access 2003 on XP.

Expand|Select|Wrap|Line Numbers
  1. SELECT [Project Basic].[Project Refrance Number], [Project Basic].*, [Design Versions].*, [Project Details].*
  2. FROM ([Design Versions] INNER JOIN [Project Basic] ON [Design Versions].[Project Refrance Number] = [Project Basic].[Project Refrance Number]) INNER JOIN [Project Details] ON [Project Basic].[Project Refrance Number] = [Project Details].[Project Refrance Number]
  3. WHERE ((([Project Basic].[Project Refrance Number])=[Forms]![Print Project List]![txtPRN]));
Sep 21 '07 #1
5 1248
Scott Price
1,384 Expert 1GB
Hi, this is my first post on this site, so my apologies if I have done this wrong. I'll also apologise for my spelling as I'm dyslexic.

I'm having a problem with a Report from my database. I have 'Project Basic', 'Project Details' and 'Design Versions' tables and they are linked by the 'Project Reference Number'. I want to produce a report using data from all three tables, ordered by Project, so I used a query to gather the data (see the sql below), then based the report on the query. I have three entrees in the tables but the report will only work with one of the records and not with the other entries.

I'm using Access 2003 on XP.

Expand|Select|Wrap|Line Numbers
  1. SELECT [Project Basic].[Project Refrance Number], [Project Basic].*, [Design Versions].*, [Project Details].*
  2. FROM ([Design Versions] INNER JOIN [Project Basic] ON [Design Versions].[Project Refrance Number] = [Project Basic].[Project Refrance Number]) INNER JOIN [Project Details] ON [Project Basic].[Project Refrance Number] = [Project Details].[Project Refrance Number]
  3. WHERE ((([Project Basic].[Project Refrance Number])=[Forms]![Print Project List]![txtPRN]));

Your WHERE clause restricts the query results to one record, as only one Project Reference Number can be returned from the text box. (as an aside, there is a misspelling in your field name: Project Refrance Number... Not a problem as long as you know what it is talking about, and it is used consistently!)

To see all records, remove the WHERE criteria.

Regards,
Scott
Sep 21 '07 #2
Your WHERE clause restricts the query results to one record, as only one Project Reference Number can be returned from the text box. (as an aside, there is a misspelling in your field name: Project Refrance Number... Not a problem as long as you know what it is talking about, and it is used consistently!)

To see all records, remove the WHERE criteria.

Regards,
Scott
Thanks for your reply Scott. I only want to print one project. When the project is selected from the Print Project List form, it returns no records, that is unless it's the record for Project RM0336.

I have restarted the database and set the query again, but with no luck. I'm trying with a sub form looking at separate queries, not too sure if this will work though.
Sep 21 '07 #3
Scott Price
1,384 Expert 1GB
Thanks for your reply Scott. I only want to print one project. When the project is selected from the Print Project List form, it returns no records, that is unless it's the record for Project RM0336.

I have restarted the database and set the query again, but with no luck. I'm trying with a sub form looking at separate queries, not too sure if this will work though.
Hmm... Just checking your FROM clause. You are setting the results to be returned from Design Versions. Are all three records present in all three tables?

If your main Project information is stored in Project Basic, you should reword your FROM clause to choose from that table.

If this by itself doesn't work, you may also need to investigate right/left joins.

To do this: In query design view grid, double click the line representing the relationship between each table. This will bring up the dialog box allowing you to set the properties for the join. Choose the appropriate join from the three options.

Regards,
Scott
Sep 21 '07 #4
Thanks Scott for your help. I managed to get round the problem by using subforms. This should do for now and I can look into this later.

Again, thanks for your help!!
Sep 21 '07 #5
Scott Price
1,384 Expert 1GB
Thanks Scott for your help. I managed to get round the problem by using subforms. This should do for now and I can look into this later.

Again, thanks for your help!!
You're welcome, Ian. Glad you got something working for you!

Regards,
Scott
Sep 21 '07 #6

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

Similar topics

3
by: Reginald | last post by:
I am trying to create a query based on 1 of 3 date fields from a table called "T40". the first date is T40RbtDte, 2nd is T40RbtRecDte, 3rd is T40RbtDueDte. I have created a form to alow the user...
1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
1
by: Pax S | last post by:
I need a button that will check (make true) two check boxes (fields) For the record that has the focus (the record on the form that I am presently looking at). The two check boxes would be like a...
1
by: lorirobn | last post by:
Hi, I have a report that works just fine. Now I would like to add the capability to choose selection criteria to limit what is displayed. I created several reports that do this, but they used...
1
by: highbulp | last post by:
I'm trying to use the DCount() function in the Report Header of a new report. The ReportSource for this report is a parametered Query. My DCount call looks like: DCount("","","=1") where...
4
by: lorirobn | last post by:
Hi, I have a report displaying items that are missing from a room. I created 2 queries, the first getting the items IN the room, and the second being an "unmatched" query that references the...
3
by: creative1 | last post by:
Here is how you create a complex data report that involves parent and child commands and you can update information at runtime. Its pretty straight forward to work with simple queries; however,...
6
by: Oko | last post by:
I'm currently developing an MS Access Data Project (.adp) in MS Access 2002. One of the reports within the DB uses data that is Dynamic and cannot be stored on the SQL Server. To resolve this, I...
7
by: Evanescent | last post by:
Hi guys, as the title suggests, I'm facing some problems with the report. I have a form (createInvoiceForm) whereby the user can enter the invoice's details and then click on the Add New Record...
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: 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
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
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...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.