View Single Post
  #1  
Old April 22nd, 2008, 10:18 PM posted to microsoft.public.access.tablesdbdesign
AccessMan
external usenet poster
 
Posts: 81
Default multiple key fields in parent table and combo boxes for foreign ke

I have the following tables and keys and am seeking a way to easily populate
Table 2 with values from Table 1.

Table 1: PK1, PK2, F1, F2, ...

Table 2: FK1, FK2, PK3, F1, F2, ...

PK1 and PK2 are primary key fields in Table 1. They are indexed with
Duplicates OK.

FK1, FK2, and PK3 are primary key fields in Table 2. FK1 and FK2 are
foriegn keys of PK1 and PK2. F1, F2, etc. are unrelated and inconsequential
non-key fields in each table.

[Table 1].PK1 has a 1:N relationship to [Table 2].FK1, and [Table 1].PK2 has
a 1:N relationship to [Table 2].FK2.

I set the Lookup Display Control to Combo Box for the foreign key fields
[Table 2].FK1 and [Table 2].FK2, and I would like each these combo boxes to
separately display the values available in the parent table fields to which
they are linked.

This is not a problem for [Table 2].FK1 - I simply specify Table 1 as the
Row Source and retain the default Bound Column value of 1.

However, I am unable to get [Table 2].FK2 to behave the same way. If I set
Bound Column and Column Count to 2 I see both columns in the combo box, and I
can seemingly select something that populates the field without violating
referential integrity, but a PK1 value is displayed and not a PK2 value.
This makes no sense to me.

My typical workaround is to create a query that yields PK2 values, and I set
the Row Source for [Table 2].FK2 to this query. It doesn't seem right that I
should have to do this, so I suspect that I am missing something quite
obvious.