Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    davehappen is offline Novice
    Windows 10 Office 365
    Join Date
    Feb 2021
    Location
    Usa
    Posts
    8

    multiple tables

    Hi all, I'm not a novice as such but have forgotten most of what i used to know (EDCL:Advanced)
    I have 5 tables all linked by a membership number, 3 of the tables carry some of the same information, is it possible to enter this info into one table and have it carry across to the other tables.
    TIA


    Dave

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,927
    You do not 'carry across' data. You put it in one place and refer to it.?
    So information should not be duplicated.?

    Even in Excel you would not duplicate the data, but use a V or H Lookup
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    ssanfu is offline Master of Nothing
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Out of curiosity,
    If 3 of the tables are identical in structure, why have 3 identical tables?

  4. #4
    CarlettoFed is offline Competent Performer
    Windows 7 64bit Access 2013 32bit
    Join Date
    Dec 2019
    Posts
    256

    Risposta

    Maybe if you attach a file it is easier to understand and therefore give you some help.

  5. #5
    davehappen is offline Novice
    Windows 10 Office 365
    Join Date
    Feb 2021
    Location
    Usa
    Posts
    8
    sorry for the long delay, been away from the computer,
    welshgasman, so i should have one table with all the information on it???
    ssanfu, the tables are not identical but carry some of the same data
    carlettofed, heres the file https://1drv.ms/u/s!Ar_qzWsihagxhb9t...n8rdw?e=ogUTSe
    TIA

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Post 5 was moderated, I'm posting to trigger email notifications.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,411
    Here's how I would start:

    dhap-davegri-v01.zip

    Click image for larger version. 

Name:	dhap.png 
Views:	37 
Size:	45.3 KB 
ID:	44257

  8. #8
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,927
    [QUOTE=davehappen;471020
    welshgasman, so i should have one table with all the information on it???
    TIA[/QUOTE]

    Not what I was saying?
    You should not duplicate data in different tables for the most part.
    An exception might be an invoice where price is copied over to show the data at that instance of time, as if the price goes up, then referring to it later, would give an incorrect value.
    In your case I would have a Member table and everywhere that the member needs to be linked, I would put the MemberID ?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  9. #9
    ssanfu is offline Master of Nothing
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I'm with davegri on the table designs/relationships, so I'll back out.

  10. #10
    davehappen is offline Novice
    Windows 10 Office 365
    Join Date
    Feb 2021
    Location
    Usa
    Posts
    8
    Many thanks everybody that took time to help, davegri thanks for the design, 100% better than i could come up with. sorry about not getting back sooner but i'm not getting any notifications, any way one last thing, i understand PK on the relationships table but not FK????

  11. #11
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,411
    Quote Originally Posted by davehappen View Post
    Many thanks everybody that took time to help, davegri thanks for the design, 100% better than i could come up with. sorry about not getting back sooner but i'm not getting any notifications, any way one last thing, i understand PK on the relationships table but not FK????
    FK suffix is Foreign Key.

    Lets take an example.
    The PK fields are all autonumbers, assigned automatically as each record is created.
    Lets say that Elmer Smith is a Member with Member_PK = 5.
    Looking at the Next of kin table, Elmer could have one or more records there. All of Elmer's NOK records need to know who they belong to (Elmer). That is accomplished by the Member_FK values in the NOK table being 5, to match Elmer's PK of 5.

    If you need help setting up your forms let me know.
    I would suggest a main form with the membershiip table as the recordsource.

    Then a tab control on the main form with 2 tabs, each containing a subform; one for NOK and one for Service Details.
    This setup will automatically assign the proper FK to both the NOK and ServiceDetails records.
    Combo boxes on the subforms will allow selection of service branch and relation type.
    Last edited by davegri; 02-18-2021 at 10:12 AM. Reason: sp, more detail

  12. #12
    davehappen is offline Novice
    Windows 10 Office 365
    Join Date
    Feb 2021
    Location
    Usa
    Posts
    8
    Hi davegri, if you could that would be great, maybe I'm getting a bit out of my depth here but i just can't grasp how this works, plus i'll be passing this on to someone who has less experience than myself (disaster looming).

  13. #13
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,411
    OK, here's the DB file:

    dhap-davegri-v02.zip

    Edit: As an afterthought, I added error handlers to all the VBA procedures. V3 is functionally exactly the same as V2, just with error handling.

    dhap-davegri-v03.zip

    Click image for larger version. 

Name:	dform.png 
Views:	22 
Size:	31.9 KB 
ID:	44296

  14. #14
    davehappen is offline Novice
    Windows 10 Office 365
    Join Date
    Feb 2021
    Location
    Usa
    Posts
    8
    davegri, that is brilliant, many many thanks, i can work with that no problem.
    Again thanks
    Dave

  15. #15
    davehappen is offline Novice
    Windows 10 Office 365
    Join Date
    Feb 2021
    Location
    Usa
    Posts
    8
    davegri, that is brilliant, many many thanks, i can work with that no problem.<br>Again thanks<br>Dave

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 08-31-2019, 09:15 AM
  2. Replies: 4
    Last Post: 09-13-2017, 06:19 AM
  3. Replies: 2
    Last Post: 03-30-2015, 12:38 PM
  4. Replies: 1
    Last Post: 08-25-2012, 06:11 PM
  5. Replies: 10
    Last Post: 07-12-2011, 11:09 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