This topic is locked

Primary/Foreign Keys selection issue

12/14/2006 10:12:38 AM
ASPRunnerPro General questions
B
berkeleyjw author

I created a master search view that I want to use as the parent of the table SRM_PERSONS. THis view allows the user to search for a person based on other criteria that is not on the SRM_PERSONS table. THis view is called SRM_PERS_SRCH_VW.
SRM_PERSONS is keyed on person_pk (auto-number).
So, I try to use SRM_PERS_SRCH_VW as the master record, and set SRM_PERS_SRCH_VW.person_pk as the key.
I set SRM_PERSONS as the detail record, but I can no longer select SRM_PERSONS.person_pk as the foriegn key. It is not just greyed out in the list, it is blanked out altogether.
I used to be able to do this. It appears the new key-selection rules built into the program are preventing me from doing this.
THe bottom line is that I need to be able to search for people in the system using additional fields in some cases (i.e. show me a list of all the students that graduated - the graduation status is not kept on the SRM_PERSONS table).
If I can no longer structure the master/detail relationship in this manner, then can I jsut modify the SQL behind the SRM_PERSONS table to allow me to search based on these other fields? Please advise. THanks.

Sergey Kornilov admin 12/14/2006

Jim,
you confusing master-detail relationships with view/query that pulls data from several joined tables.
Having autonumber field as a foreign keyin Details table just don't make any sense. You create Master record first and then add/attach Detail records to this master table. You cannot do this backwards.
For multitable search purposes use JOIN SQL query or a view in SQL Server.