Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Querying Forms & Subforms

Status
Not open for further replies.

3outta5

Programmer
May 27, 2000
6
US
I am still learning Access. I have a Form called &quot;Company&quot;, containing company information. To this form I have a subform listing the different machines they own. This subform is called &quot;Machines&quot;. To the &quot;Machines&quot; form I have 2 subforms, one called &quot;Service&quot; and the other called &quot;Parts&quot;. I am tracking the service issues and any parts ordered for the different machines owned by the different companies that are in our database.<br><br>For each individual company I have no problem seeing the service issues and the parts orders. My problem is that I want to be able to go to a screen and see all service issues or go to a different screen and see all parts on order for all customers. I am confident that a query is the answer. From that query I would build a form. My problem is the results of my query will only show my &quot;Service&quot; (for instance) data. I can not get the &quot;Company&quot; or &quot;Machine&quot; info. in the query.<br><br>I suspect relationships are the key, but I could really use some help.
 
I explained in my original post that I did create a query with all of the necessary forms included in the query. However, only the information on one of the forms was returned when I ran the query, the other two left blank columns.<br><br>I have been so unsuccessful with this I am begining to wonder if you can do a query on a form and its' related subforms in the same query and get results for all three forms/subforms.
 
There should be a relationship between the main form and the subforms that you are referring to.&nbsp;&nbsp;You need to define these relationships in your query to see all related data in the queries output.&nbsp;&nbsp;If you are using the query design view in Access, you can define these relationships simply by dragging the field in one table over the related/linked field in the other table(s).&nbsp;&nbsp;This will let the query know that you want all records in the tables that are linked where the fields match.<br><br>Hope this sheds some light on your issue.
 
are you trying to query the forms? Or are you saying that you queryed the tables that the forms were made from?&nbsp;&nbsp;Am I missing something here? Do you have a different table for every form? or is there only one table with all of this information, and you've made different forms from all of them?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top