Results 1 to 10 of 10
  1. #1
    JasonMB is offline Novice
    Windows 10 Office 365
    Join Date
    Dec 2021
    Posts
    5

    Access Newbie - Constructing a DB with two-level relationships


    Forgive me for posting what is likely an incredibly elementary design question in order to construct a relational DB I need for a project.

    ISSUE
    I need to be able to query a municipality and identify staff that works in other municipalities. Furthering that relationship, if there are staff members in the municipality at the second level of the relationship, identify any staff also work in any other municipalities.

    RESULT
    The result I'm looking for is if I select Boise (Municipality A), for example, it will tell me if any of the staff there works in another municipality (Municipality B). Furthermore, if staff at Municipality B works at yet another municipality (other than Municipality A) it will be included in the report.

    I used to be able to design these kinds of relationships in a GIS environment quite easily but Access is a foreign language to me.

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    You would have a record for each person in each location.

    Likely many to many relationship?
    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
    JasonMB is offline Novice
    Windows 10 Office 365
    Join Date
    Dec 2021
    Posts
    5
    Yes, I already have a sheet created that has records for each municipality and each staff member.

  4. #4
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250
    I think you are looking for a hierarchical query, this is quite a common topic, you will probably need to use self joins to get you what you're after:
    https://stackoverflow.com/questions/...in-access-2010
    https://stackoverflow.com/questions/...port-in-access

    Here is the Google search:
    https://www.google.com/search?q=acce...client=gws-wiz
    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  5. #5
    JasonMB is offline Novice
    Windows 10 Office 365
    Join Date
    Dec 2021
    Posts
    5
    Thanks for providing these resources! I'll dive in.

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    I already have a sheet created that has records for each municipality and each staff member.
    Are we to assume, you'll be bringing that data into Access? I recommend you describe your set up in a little more detail with examples. Second level..

  7. #7
    JasonMB is offline Novice
    Windows 10 Office 365
    Join Date
    Dec 2021
    Posts
    5
    Quote Originally Posted by orange View Post
    Are we to assume, you'll be bringing that data into Access? I recommend you describe your set up in a little more detail with examples. Second level..
    Existing Sheets include:
    1. Municipalities - Fields include [County] [Municipality Name] [Municipality Common Name] [Municipal Code]
    2. Officials - Fields include [Municipality Common Name] [FirstName] [LastName] [Title] [Municipal Code]

  8. #8
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Well, sheets implies spreadsheet _ Excel. This is an Access forum, so you could import or link to your "sheet data".

  9. #9
    JasonMB is offline Novice
    Windows 10 Office 365
    Join Date
    Dec 2021
    Posts
    5
    Quote Originally Posted by orange View Post
    Well, sheets implies spreadsheet _ Excel. This is an Access forum, so you could import or link to your "sheet data".
    The excel sheets have already been imported into Access as separate tables.

  10. #10
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    It is very rare excel sheet(s) can be imported into access and be normalized? Normally it is the reverse, in that the data is NOT normalized
    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

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

Similar Threads

  1. Replies: 9
    Last Post: 08-18-2020, 02:32 AM
  2. Constructing Query for Linked Tables
    By Mircea in forum Queries
    Replies: 5
    Last Post: 02-26-2019, 03:06 PM
  3. Replies: 2
    Last Post: 10-10-2015, 10:34 AM
  4. Newbie to access and asking for help with relationships
    By WHAMMER in forum Database Design
    Replies: 9
    Last Post: 02-04-2014, 03:18 PM
  5. Replies: 6
    Last Post: 09-26-2011, 11:16 AM

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