View Single Post
  #3  
Old August 31st, 2009, 12:39 AM posted to microsoft.public.access.gettingstarted
Steve[_77_]
external usenet poster
 
Posts: 1,017
Default Populating foreign key fields?

Your Customer and Sales tables should look like:

TblCustomer
CustomerID
other customer fields

TblSale
SaleID
CustomerID
Other Sale fields

TblSaleDetail
SaleDetailID
SaleID
Line item fields

Your data entry form should be a form/subform. The main form should be based
on TblSale and your subform should be based on TblSaleDetail. The Linkmaster
and Linkchild property should be SaleID. In the main form you will enter
CustomerID using a combobox. The rowsource of the combobox would be
TblCustomer. In the subform, when you enter data in the line item fields in
a record, Access will automatically enter the SaleID in the main form for
SaleID because you have SaleID as the Linkmaster/Linkchild property.

Steve



"Susita" wrote in message
...
I am attempting to learn Access via the demos - but still need help - I am
setting up relationship between a Sales, Supplier & Customer tables. When
I
create a foreign field in these tables - do I need to populate this new
field
manually? If the Access issued ID numbers for each customer and supplier
are
present in those tables - how can I get those ID numbers to be recognized
in
the foreign fields? There are quite a few customers - with many Sales. .
.
Please help -