Viewing only certain records in a query

S

Simon Dowse

Hi,

Is there anyway to create a query to show only selected
records, as per the details below!

I have 2 tables, t1 and t2 lets say, and in t1 there is a
reference number, so each bit of information in that table
has a unique number. In t2 there is a field that says 't1
reference number associated to'. What I want to do is
create a form based on t1 and then a subform that only
shows records from t2 that are associated with the
matching reference number in t1. So if there is 5 rows of
info in t2 that are related to reference 1 in t1, I only
want these to show in the subform, not any that are
related to other reference numbers.

Any ideas?
 
A

Allen Browne

Simon, this is how subforms are designed in Access.

Create a main form into t1.
Create a subform into t2.

If you have created a relationship between the two tables (Tools |
Relationships), Access will probably give you exactly what you want at this
point. If not, open the main form in design view, and set these properties:
LinkMasterFields: name of the reference field in t1
LinkChildFields: name of the related field in t2.
 

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