Can I query multiple tables in a subform?

Form_Main is built on a query of tbl_Project. I would like the subform to query from more than one table based on project_id. Structure of two tables is below:

tbl_business_prob_details:

bus_prob_details_id
project_ID
business_Prob_Info_needed
element_id
transform_ID

tbl_transform:

transform_id
project_id
business_prob_details_id
element_ID
transform_Details

The subform is linked between tables tbl_project and tbl_business_prob_details on project_id. The following query as the record source for the subquery works fine:

SELECT [tbl_Business_Prob_Details].[Business_Prob_Details_ID], [tbl_Business_Prob_Details].[Business_Prob_ID], [tbl_Business_Prob_Details].[Business_Prob_Info_Needed], [tbl_Business_Prob_Details].[Element_ID], [tbl_Business_Prob_Details].[Transform_ID] FROM tbl_Business_Prob_Details;

But I'm confused as to why the following, trying to select from more than one table, will not work:

SELECT [tbl_Business_Prob_Details].[Business_Prob_Details_ID], [tbl_Business_Prob_Details].[Business_Prob_ID], [tbl_Business_Prob_Details].[Business_Prob_Info_Needed], [tbl_Business_Prob_Details].[Element_ID], [tbl_Business_Prob_Details].[Transform_ID],
[tbl_transform].[transform_id],
[tbl_transform].[transform_details]
FROM tbl_Business_Prob_Details, tbl_transform
WHERE [tbl_Business_Prob_Details].[Transform_ID]=[tbl_transform].[transform_id];

BTW, the form won't even open, it just comes up blank and doesn't show any textboxes or other controls.

Thanks in advance,
Chris


crafuseAsked:
Who is Participating?
 
GRayLCommented:
I think the subform has to be linked between tbl_Projects and the Query, not [tbl_Business_Prob_Details].
0
 
peter57rCommented:
Hi crafuse,

Amongst other reasons, the form will be blank if:
a) the underlying query is not updateable ( true in this case) and
b) there is no subform data to show for existing records

You should run your subform query on its own and see what results you get.
Check that there is data matching the first project_id in the main form.


Pete
0
 
crafuseAuthor Commented:
Can't remember what I did to solve the problem - I'm just diving in to Access, and I'm trying about 10 different things on ten different test forms, but I'm muddling through...

Thanks for the help...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.