Combining two tables into a query to make a report that displays o

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a database that has a main table and sub-table. I am trying to create
a report that will display the current record and the related info on the
sub-form. I was trying to use a SQL/Query. Any help thanks.
 
Matt

Create a new query. Add both tables. Join them on their related field(s).
Add fields from both that you want in the report. Save and close the query.

Create a new report. For a source, point at the query you just created.

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
 
Access will do that for you.
The Record Source of the main form should be the main table.
The Record Source of the sub form should be the child table.

Sub forms are contained in a subform control. Two properties of the subform
control are Link Master Fields and Link Child Fields. Put the name of the
field in the main table that links to the child time in the Link Master
Fields. Put the name of the field in the child table that links the child to
the master in the Link Child Fields.
 
Thanks. I have my Main form set up. Like that but now i am trying to creat a
button on my form that will display a report based on that current record
pulling from both tables.
 
Thanks. I have my Main form set up. Like that but now i am trying to creat a
button on my form that will display a report based on that current record
pulling from both tables.
 
Create the query from your tables and use it as the record source of the
report.

The use the Where argument of the OpenReport method to specify the record.
It would be the primary key field of the main table.
strWhere = "[ClientID] = " & Me.txtClientID
Docmd.OpenReport "MyReport", , ,strWhere
 
Back
Top