I hate Reports!

G

Guest

I have a data base that uses a formand subforms (One of which is continous)
to enter data into several related tables. This form is a questionairre.
I am trying to create a report to print out the data from each questionairre
seperatly.
Perhaps I am going about this the wrong way.
I have created a query to select which questionairre I wish to print.
Unfortunately if I include the continuos field in the query it only shows the
first instance.
If I use a query to populate a main report and then use a subreport to show
the other data I am unable to link the fields because the main forms field
name is different i.e its name is "table.fieldname" where as the subform
child field is "fieldname", I assume its this difference which prevents the
sub report from displaying the relevant information.
Any Help?
 
P

Pieter Wijnen

I Assume you have the same fieldname from 2 tables included in your query

ie
SELECT A.ID, A....., B.ID, B..... FROM A INNER JOIN B ...
-- or --
SELECT A.*, B.* FROM A INNER JOIN B....

2 solutions:
1) remove 1 of the ID fields from the select
2) Alias 1 of the ID fields
SELECT A.ID AS LinkField, A....., B.ID, B..... FROM A INNER JOIN B ...
-- or --
SELECT A.*, B.*, A.ID AS LinkField FROM A INNER JOIN B....

HTH

Pieter
 
P

Pieter Wijnen

I Assume you have the same fieldname from 2 tables included in your query

ie
SELECT A.ID, A....., B.ID, B..... FROM A INNER JOIN B ...
-- or --
SELECT A.*, B.* FROM A INNER JOIN B....

2 solutions:
1) remove 1 of the ID fields from the select
2) Alias 1 of the ID fields
SELECT A.ID AS LinkField, A....., B.ID, B..... FROM A INNER JOIN B ...
-- or --
SELECT A.*, B.*, A.ID AS LinkField FROM A INNER JOIN B....

HTH

Pieter



Accessidiot said:
I have a data base that uses a formand subforms (One of which is continous)
to enter data into several related tables. This form is a questionairre.
I am trying to create a report to print out the data from each
questionairre
seperatly.
Perhaps I am going about this the wrong way.
I have created a query to select which questionairre I wish to print.
Unfortunately if I include the continuos field in the query it only shows
the
first instance.
If I use a query to populate a main report and then use a subreport to
show
the other data I am unable to link the fields because the main forms field
name is different i.e its name is "table.fieldname" where as the subform
child field is "fieldname", I assume its this difference which prevents
the
sub report from displaying the relevant information.
Any Help?



--
 
G

Guest

I have used a query to populate the main report, then I am using the master
child to populate a sub report from a different table that has a foriegn key
which matches the primary key in the first table(That the query is based on)
But in the master child link box it shows the child field as "InspectionId"
and the Master as "Inspection.InspectionId" ("Inspection" being the name of
the table). The subreport does not get populated with any data and I assume
this is because the names are different?

Perhaps I am going about the whole thing wrong?
Ian
 
P

Pieter Wijnen

trust me,
this will only happen if the aforementioned conditions apply
get rid of the duplicate field names from the query & you're ok

Pieter
 
P

Pieter Wijnen

trust me,
this will only happen if the aforementioned conditions apply
get rid of the duplicate field names from the query & you're ok

Pieter

Accessidiot said:
I have used a query to populate the main report, then I am using the master
child to populate a sub report from a different table that has a foriegn
key
which matches the primary key in the first table(That the query is based
on)
But in the master child link box it shows the child field as
"InspectionId"
and the Master as "Inspection.InspectionId" ("Inspection" being the name
of
the table). The subreport does not get populated with any data and I
assume
this is because the names are different?

Perhaps I am going about the whole thing wrong?
Ian



--
 
G

Guest

How foolish of me! I see what you mean, I was using the * field to enter
fields and also a duplicate for the parameter.
Thank you
 
P

Pieter Wijnen

been there, done that

Pieter

Accessidiot said:
How foolish of me! I see what you mean, I was using the * field to enter
fields and also a duplicate for the parameter.
Thank you
 
P

Pieter Wijnen

been there, done that

Pieter

Accessidiot said:
How foolish of me! I see what you mean, I was using the * field to enter
fields and also a duplicate for the parameter.
Thank you



--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top