Results 1 to 8 of 8
  1. #1
    em07189 is offline Novice
    Windows 7 Access 2007
    Join Date
    Jan 2010
    Posts
    10

    how can i link a field of atable to other one that has always the same data?


    hi everyone!

    How can i link a table field with other one that has always the same records

    for example:

    table1 has the fields:

    equip|qty|

    table 2 has always the same following fields and records:

    comp| cod | qty |
    x1 | x11 | x12
    x2 | x21 | x22

    i want to link every equip field of table1 to table2 that has always the same data?

    hopes this helps to understand what i want .

  2. #2
    llkhoutx is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Jan 2010
    Location
    Houston, Texas USA
    Posts
    373
    Table tbEquip
    PKEquip
    Equip

    Table tbComp
    PKComp
    FKEquip
    txtComp
    txtCod
    intQty

    In the Relationships window connect tbEquip.PKEquip and tbComp.FKEquip with cascading unpdates and cascading deletes.

    I doubt that you want intQty in tbEquip.

  3. #3
    em07189 is offline Novice
    Windows 7 Access 2007
    Join Date
    Jan 2010
    Posts
    10
    HI!

    what are cascading updates?

  4. #4
    llkhoutx is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Jan 2010
    Location
    Houston, Texas USA
    Posts
    373
    You could have looked this up yourself.

    http://www.ehow.com/how_13631_unders...g-updates.html

  5. #5
    em07189 is offline Novice
    Windows 7 Access 2007
    Join Date
    Jan 2010
    Posts
    10
    HI llkhoutx!

    do you have a special reason why you put the prefix's "PK" before "Equip",
    also PK before Comp,FK before Equip,txt before Comp,Cod and int before Qty???


    Quote Originally Posted by llkhoutx View Post
    Table tbEquip
    PKEquip
    Equip

    Table tbComp
    PKComp
    FKEquip
    txtComp
    txtCod
    intQty

    In the Relationships window connect tbEquip.PKEquip and tbComp.FKEquip with cascading unpdates and cascading deletes.

    I doubt that you want intQty in tbEquip.

  6. #6
    em07189 is offline Novice
    Windows 7 Access 2007
    Join Date
    Jan 2010
    Posts
    10
    Hi llkhoutx!

    what i wanted is to link every record from tbEquip with the every content of table 2

    -for example in picture bellow it should happear 425 - 44 - 4 - 4, for both record 1 and 6 . i'ts possible to do this? i have also attachaded the file test__5.zip, with this example.



  7. #7
    llkhoutx is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Jan 2010
    Location
    Houston, Texas USA
    Posts
    373
    Using prefixes on fields and variables immediately identifies what data type the field/variable is.

    PK == primary key
    FK == foreign key
    int == integer
    txt == text

    Using this notation (see http://www.exceluser.com/explore/vbastds.htm, http://en.wikipedia.org/wiki/Hungarian_notation and http://en.wikipedia.org/wiki/Hungarian_notation), Long after a program is written, it is easier to read and understand.

    You left the foreign key control out of table tblComp causing tblEquip and tblComp to not be related. Build that relationship in the Relationship window, after first adding field FKEquip (having a numeric data type) to table tblComp. Then your tables will tumble correctly.

    Did you read what cascading updates/deletes are about? I gave you a link.

  8. #8
    em07189 is offline Novice
    Windows 7 Access 2007
    Join Date
    Jan 2010
    Posts
    10
    Yes i have read it. thanks a lot for your help.

    Quote Originally Posted by llkhoutx View Post
    Using prefixes on fields and variables immediately identifies what data type the field/variable is.

    PK == primary key
    FK == foreign key
    int == integer
    txt == text

    Using this notation (see http://www.exceluser.com/explore/vbastds.htm, http://en.wikipedia.org/wiki/Hungarian_notation and http://en.wikipedia.org/wiki/Hungarian_notation), Long after a program is written, it is easier to read and understand.

    You left the foreign key control out of table tblComp causing tblEquip and tblComp to not be related. Build that relationship in the Relationship window, after first adding field FKEquip (having a numeric data type) to table tblComp. Then your tables will tumble correctly.

    Did you read what cascading updates/deletes are about? I gave you a link.

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

Similar Threads

  1. Data won't show up in table field
    By texzen123 in forum Forms
    Replies: 3
    Last Post: 11-26-2009, 11:20 AM
  2. Replies: 13
    Last Post: 11-25-2009, 03:10 PM
  3. Link ComboBox to field in a table
    By DrDebate in forum Forms
    Replies: 0
    Last Post: 04-27-2007, 08:03 AM
  4. Replies: 1
    Last Post: 03-02-2006, 06:17 AM
  5. Field gets data from Expression?
    By Willot in forum Access
    Replies: 3
    Last Post: 12-10-2005, 06:28 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