dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: MS Access query

  1. #1
    Registered User
    Join Date
    Jul 2000
    Posts
    88
    Hi folks, I know this has bugger all to do with the magical Flash, but I thought I'd tow my line in this forum since it's populated by kindly souls, and is on a fine site.

    Anyway, I'm tinkering with an Access dB. I have 2 tables, one main one, and a small one called 'employees'. Right, you can select the employee name from a drop down menu on this input form I've made. This form is using the data in the main table, but references the employee table for the people's names.

    Now I know very little about relationships, but understand that if I set one up between the tables I could get it so that for example, if Jo Bloggs leaves, and his Employee ID is used by Jonny Briggs, then all the instances of Jo Bloggs in the main table would go and be replaced by Jonny Briggs.

    I'd really appreciate a bit of a laymans explanation as to how this is done, since I'm stuck. Do I need to put in the primary key of the employees table as a foreign key in the main table? If I do this though all I have is a list of ID numbers, not names.

    TIA

    jim

  2. #2
    Senior Member
    Join Date
    Oct 2000
    Posts
    200

    Cool

    If employee ID is a primary key in one of the tables and the other table was related to that table by a One-to-Many relationship on the fields employeeID,(primary key of one table and foreign key of the table you want to create the relationship between),then if you enforce referential integrity AND tick the box that says Cascade Update when you create the relationship, then all records related to that ID would be changed.

    So, say that employee Fred is ID# 1, if you changed Fred’s name to Zaphod, then all records in the related table that belonged to Fred would now belong to Zaphod.

  3. #3
    Registered User
    Join Date
    Jul 2000
    Posts
    88

    ta!

    Hi Riff,

    thanks very much for the feedback, a great help!

    Cheers

    Jim

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center