Results 1 to 5 of 5
  1. #1
    hardya is offline Novice
    Windows 7 Access 2007
    Join Date
    Feb 2010
    Posts
    3

    Selecting foreign key values on data entry

    When I do data entry and I am completing data for the field of a foreign key on which referential integrity is enforced with the primary ey field in the referenced table....



    I don't get a list of the required foreign key values from the referenced table, I jus guess and if it's a bit wrong I get a ref integr' error message.

    Any options I can set to see a list or do auto completion. I don't want to create a fancy user form etc I just want to trun on an option for the basic data entry oif that's possioble

    Any help or advice for this access newbie greatly appreciated

  2. #2
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    difficult to interpret your post keys (primary or foreign) are simply a field which appears in more than one table and cross reference specific records....

    thus primary key 1 for Joe in the Customer table
    has a (foreign key) 1 in the Sales table record also.... so you know that this sales record is linked to Joe. that's it. no need to make it any more complicated. just common sense cross reference - really only to avoid re-entering Joe's customer data into each sales record....

    In Access - assuming you properly set up your tables with the cross referencing field - then setting up a Form with a Subform using the wizard - it prompts you as to that cross referencing field - and once set - whenever you enter data into the subform the key value is being entered into each record automatically.

  3. #3
    hardya is offline Novice
    Windows 7 Access 2007
    Join Date
    Feb 2010
    Posts
    3
    I have set up referential integrity between Table A foreign key and other table B primary key.

    This is being enforced as I expected.

    I simply hoped that in datasheet view the access front end might possibly provid a 'simple and specific' mechanism to be able to choose from the table A primary key values (required by the enforced refential integirty foreign key constraint) to enter a value in this table A foreign key field, rather than simply entering a value that I 'think is right' and discovering I it was only almost right when I go to the next row.

    Not sure how else to explain it really.

    Thanks again for support for this access newbie

  4. #4
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    again; set up the main form sourced on the parent table - and insert the child table as a subform

    if you work directly in the child table itself - via dataview or whatever - then yes - you must guess the primary key; it is the form/subform set up that allows a db to link between tables as part of the user interface

  5. #5
    hardya is offline Novice
    Windows 7 Access 2007
    Join Date
    Feb 2010
    Posts
    3
    Thanks

    I found a way in the design view lookup tab that impacts on the behaviour of the datasheet view.

    Though it is a feature with various lookup options rather than one just to pick from the enforced referenced pk values in table b.

    Thanks again.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Redundant data entry question
    By mathonix in forum Forms
    Replies: 3
    Last Post: 01-29-2010, 08:54 AM
  2. Replies: 1
    Last Post: 09-29-2009, 04:34 AM
  3. Subform Data Entry Issue
    By yuriyl in forum Forms
    Replies: 3
    Last Post: 05-14-2009, 08:49 PM
  4. Data Entry And Data Recalling
    By GeeDee in forum Access
    Replies: 0
    Last Post: 05-01-2007, 05:20 AM
  5. Foreign Data
    By bmiller in forum Queries
    Replies: 0
    Last Post: 03-21-2006, 01:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums