How do I create my subform?

T

Tony Williams

I have a form which has a combo box containing the names of companies based
on tblbusiness. When I select a company I want it to trigger the population
of a subform that contains the names of individulas (txtfirstname and
txtsurname) from a table called tblindividual. I've tried all different
combinations basing the form on a query but I can't get it right. The form
and main form are linked on two fields in each table called txtbusinessname.
Ther are 12 businesses but I get 30 records which is the number of
individuals, so some companied are repeated by the number of individuals in
that company. Here is my sql from the subform
SELECT tblindividual.txtfirstname, tblindividual.txtsurname,
tblindividual.txtbusinessname FROM tblindividual RIGHT JOIN tblBusiness ON
tblindividual.txtbusinessname = tblBusiness.txtbusinessname;
Anyone help?
Thanks
Tony
 
R

Roger Carlson

You've got two tables, tblindividual and tblBusiness in a one-to-many
relationship, right? Your main form should be base on the tblBusiness table
and the subform should be based on the tblindividual table. You do not need
to base the subform on a Join as you have.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 

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