Hi All,
I am working on this project which requries making a product by adding one of 7 types of components (each type of component in turn has many variations).
product is made of about 25 components. the purpose of this project is to make a record of each item that has gone into making of each product.
I have created 7 tables for maintaining record of each type of component (which has 23 fields each) and there is a master table which will hold unique ID of each component for about 25 components. inshort each product has 7 x 25 x 23 = 4025+ details.
Now i have to generate a report which should give details of product made from its unique ID selected by user. the report should be for a single product made and not all the products made.
I am using access 2003 Pro with SP2 on Win XP
Now from report i want to run a query which will take input from the product number selected. result of the query should be assigned to text / lable placed in report. i am not able to figure out how to go about reading record data from a query into report.
can you guys help?
thanks !
23 1944
I assumed everything is linked through some sort of product ID, you should be able to create a query that selects these product IDs.
I assumed everything is linked through some sort of product ID, you should be able to create a query that selects these product IDs.
Hi Rabbit,
I wrote a query which displays correct data but can not read its results into the report. my problem is further compounded as i'll need to read data from atleast 25 queries into this report.
i have decided is to use Dlookup function to carryout this task.
is there a way to loop through the fields of a table without specifying the actual name of the field? say if a table has fields such as
name
lastname
middlename
age
address etc
can i address lastname by '2' or something like it?
thanks for your help.
Regards,
cyclops
NeoPa 32,556
Expert Mod 16PB
That's not how it works Cyclops.
You need to create a query (single query) that your report can run from. Sub-reports can also be used but each individual report needs a single datasource (usually a query) that it is bound to.
DLookup() is not a good idea for building up reports with. That's what queries are for.
But NeoPa, my report will need to access multiple queries to get completed. if a report needs a single datasource then my report is not going to be complete.
any alternate method that i should try out?
thanks !
But NeoPa, my report will need to access multiple queries to get completed. if a report needs a single datasource then my report is not going to be complete.
any alternate method that i should try out?
thanks !
Subreports.
NeoPa 32,556
Expert Mod 16PB
Subreports.
... and if that doesn't do the trick then consider multiple separate reports.
But don't forget, if you use a query you can get data from several different sources (tables). Hence 1 report may well work still.
... and if that doesn't do the trick then consider multiple separate reports.
But don't forget, if you use a query you can get data from several different sources (tables). Hence 1 report may well work still.
Dear NeoPa & Rabbit,
subforms have solved my problem, thanks a lot for your suggestion !
I have made a form which asks the user to select a product number (from a combo box). this number is stored in a table for the queries on subform (about 25 of them) to access and display the results.
is there an efficient way to pass on the value from combo box to these queries?
thanks & have a nice day !
Cyclops
when the VB code writes product number into the table that i have made, it gives an alert message saying "you are about to update 1 row(s)". is there a way to stop it?
thanks,
cyclops
Dear NeoPa & Rabbit,
subforms have solved my problem, thanks a lot for your suggestion !
I have made a form which asks the user to select a product number (from a combo box). this number is stored in a table for the queries on subform (about 25 of them) to access and display the results.
is there an efficient way to pass on the value from combo box to these queries?
thanks & have a nice day !
Cyclops
You can pass a value from an open form to the query by referring to it with the syntax Forms![Form Name]![Control Name]
when the VB code writes product number into the table that i have made, it gives an alert message saying "you are about to update 1 row(s)". is there a way to stop it?
thanks,
cyclops
Surround the part of the code that runs the SQL with: - DoCmd.SetWarnings False
-
...
-
DoCmd.SetWarnings True
You can pass a value from an open form to the query by referring to it with the syntax Forms![Form Name]![Control Name]
thanks Rabbit for the tip ! i was able to get the required results.
Surround the part of the code that runs the SQL with: - DoCmd.SetWarnings False
-
...
-
DoCmd.SetWarnings True
once i get the query input direct from the form, this is not requried now. thanks!
now i am facing another problem. query that i have written now throws two records whenever the part1 qty is more than 1 where there is actually only one record. the query is as follows. -
SELECT DISTINCT Component1.*, productdetails.part1Qty
-
FROM Component1, productdetails
-
WHERE (Component1.Component1ID)=(SELECT productdetails.[part1] FROM productdetails WHERE (productdetails.[ProductNumber] =Forms!ProductNumber!ProductNo_ComboBox));
-
what could i be doing wrong?
now i am facing another problem. query that i have written now throws two records whenever the part1 qty is more than 1 where there is actually only one record. the query is as follows. -
SELECT DISTINCT Component1.*, productdetails.part1Qty
-
FROM Component1, productdetails
-
WHERE (Component1.Component1ID)=(SELECT productdetails.[part1] FROM productdetails WHERE (productdetails.[ProductNumber] =Forms!ProductNumber!ProductNo_ComboBox));
-
what could i be doing wrong?
I think i got it. i should have created an inner join like this. -
SELECT DISTINCT Component1.*, productdetails.part1Qty
-
FROM productdetails INNER JOIN Component1 ON productdetails.part1 = Component1.Component1ID
-
WHERE (Component1.Component1ID)=(SELECT productdetails.[part1] FROM productdetails WHERE (productdetails.[ProductNumber] =Forms!ProductNumber!ProductNo_ComboBox));
-
am i correct ?
No, this does not seem to work. can u help?
thanks
NeoPa 32,556
Expert Mod 16PB
You are on the right lines, but to know precisely what you need, one would have to know how your data (tables) fit together.
Try posting the MetaData for both tables.
Here is an example of how to post table MetaData : Table Name=tblStudent - Field; Type; IndexInfo
-
StudentID; Autonumber; PK
-
Family; String; FK
-
Name; String
-
University; String; FK
-
Mark; Numeric
-
LastAttendance; Date/Time
Try: -
SELECT DISTINCT Component1.*, productdetails.part1Qty
-
FROM productdetails INNER JOIN Component1 ON productdetails.part1 = Component1.Component1ID
-
WHERE (productdetails.[ProductNumber] =Forms!ProductNumber!ProductNo_ComboBox);
-
You are on the right lines, but to know precisely what you need, one would have to know how your data (tables) fit together.
Try posting the MetaData for both tables.
Here is an example of how to post table MetaData : Table Name=tblStudent - Field; Type; IndexInfo
-
StudentID; Autonumber; PK
-
Family; String; FK
-
Name; String
-
University; String; FK
-
Mark; Numeric
-
LastAttendance; Date/Time
here is the MetaData (partial) table name =component1 - component1ID; Autonumber
-
Length; Integer
-
Width; Integer
-
Thickness; Integer
-
Strength; Numeric
table name = productdetails - productID;autonumber
-
productnumber;string;indexkey
-
part1;Numeric
-
part2;Numeric
etc.
i think i have got the solution...
i have modified the query like this.. - SELECT DISTINCT Component1.*, productdetails.part1Qty
-
FROM Component1, productdetails
-
WHERE (((Component1.Component1ID)=(SELECT productdetails.[part1] FROM productdetails
-
WHERE (productetails.[ProductNumber] = Forms!ProductNumber!ProductNo_ComboBox)))
-
AND ((productdetails.ProductNumber)=[Forms]![ProductNumber]![ProductNo_ComboBox]));
this has worked !
now i have next problem.... i hope i am not bothering you all too much ;-)
I have now a report with about 25 subreports into it. If query from one of the subreports gives no result (ie. that part is not used for the product) then on main report it leaves a blank.
I do not want this bank to appear. The subreports below it should move up such that the report does not indicate in any way that there could have been a part here which is not used.
Any thoughts? Will share with you the solution as soon as I find one !
thanks & have a nice day !
I have now a report with about 25 subreports into it. If query from one of the subreports gives no result (ie. that part is not used for the product) then on main report it leaves a blank.
I do not want this bank to appear. The subreports below it should move up such that the report does not indicate in any way that there could have been a part here which is not used.
Any thoughts? Will share with you the solution as soon as I find one !
thanks & have a nice day !
ha ha ha ! sometimes the solution is simple but one makes it complicated (atleast i did it!).
i just had to make the CanShrink Property of all subreports to Yes from default No and it did the trick !
Thanks a lot for your time! will get back to you incase i get stuck somewhere else.
Regards,
Cyclops
NeoPa 32,556
Expert Mod 16PB
Well, this is a turn-up for the books. Not only do we have an OP with multiple questions in this thread, but we also has one that's providing all the answers too. Obviously no impairment of his sight - Eh Cyclops?
With your responsive replies I would have been happy to offer further help but it seems it is no longer necessary (In such a short time too :D)
Well, this is a turn-up for the books. Not only do we have an OP with multiple questions in this thread, but we also has one that's providing all the answers too. Obviously no impairment of his sight - Eh Cyclops?
With your responsive replies I would have been happy to offer further help but it seems it is no longer necessary (In such a short time too :D)
Hey NeoPa, thanks for your offer... I will save it for future ;-)
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Dariusz |
last post by:
Below is part of a code I have for a database. While the database table is
created correctly (if it doesn't exist), and data is input correctly into
the database when executed, I have a problem...
|
by: Andy |
last post by:
Hi,
In the code below (not pretty I know but it's an early version :-P) I'm
having problems reading the data object back in. If I move the reading
code to immediately after the section where it...
|
by: Magnus |
last post by:
allrite folks, got some questions here...
1) LAY-OUT OF REPORTS
How is it possible to fundamentaly change the lay-out/form of a report in
access? I dont really know it that "difficult", but...
|
by: Robin Cushman |
last post by:
Hi all,
I need some help -- I'm working with an A2K database, using DAO, and
am trying to read records into a Crystal Report and then export it to
a folder on our network as an Excel...
|
by: amith.srinivas |
last post by:
Hi all,
From a word macro in VBA, I am trying to create a report in
access DB. The report is based on a query with a parameter. I am using
Set rpt = Application.CreateReport
rpt.RecordSource =...
|
by: sara |
last post by:
I am helping a non-profit track their elder clients and care given to
the clients.
The organization would like a report that shows various info on ALL
clients, such as:
# in each town,
# and...
|
by: =?Utf-8?B?U2hlZXMgQWJpZGk=?= |
last post by:
I read an article on the link:
http://support.microsoft.com/default.aspx?scid=kb;en-us;306572 related to
reading data from Excel using OLEDB The topic's heading is: How to query and
display excel...
|
by: mb60 |
last post by:
I generated a query based report from access table.I would like to save it in the table for future reference.
Reason:
Generated report is a mcq question paper of a chapter. If I would like to...
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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: 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,...
|
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...
|
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,...
|
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: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |