Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Can I query multiple tables in a subform?

Posted on 2006-05-01
3
Medium Priority
?
213 Views
Last Modified: 2012-05-05
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


0
Comment
Question by:crafuse
3 Comments
 
LVL 77

Assisted Solution

by:peter57r
peter57r earned 375 total points
ID: 16577204
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
 
LVL 44

Accepted Solution

by:
GRayL earned 375 total points
ID: 16577335
I think the subform has to be linked between tbl_Projects and the Query, not [tbl_Business_Prob_Details].
0
 

Author Comment

by:crafuse
ID: 16597755
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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question