+ Reply to Thread
Results 1 to 5 of 5

Many to Many Relationship Access DB

  1. #1
    Registered User
    Join Date
    12-26-2024
    Location
    USA
    MS-Off Ver
    365
    Posts
    16

    Many to Many Relationship Access DB

    I am trying to put together what I originally thought would be a simple database. I currently just use an Excel Spreadsheet to sort out what I'm about to ask.

    I have attached a db that has 4 tables:

    "TblRules" is a table that has a list of rules.
    "TblDevices" is a list of devices used in the rules.
    "TblVariables" is a list of variables used in the rules.
    "TblConnection" is a list of how the devices and variables are connected to each rule.

    What I want is:

    a way to search a "device" and find every rule that it is associated with.
    a way to search a "variable" and find every rule that it is associated with.
    a way to search a "rule" and find every "device" and "variable" associated with it.

    I would also want an easy way to edit an existing rule, such as add a "device" or "variable", or remove them as well.

    I think I'm hung up on this needing to be a many to many relationship. I have not dabbled in Access in several decades, so I'm hoping any suggestions will turn on a light.

    Rules.zip

    I had posted this question on https://www.utteraccess.com/topics/2.../posts/2827814 but did not get the help I need.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2411
    Posts
    26,673

    Re: Many to Many Relationship Access DB

    What are the relationships between device-rule, variable-rule? Can the same device appear in multiple rules? Can a rule have more than one device? Same questions for variable. An entity-relationship diagram would be a good start to communicate your data model.

    If everything is many-to-many then your connections table is a normalized way of modeling this. Given that you already have that, I'm unclear as to your question--are you looking for the logic to actually manage this model?

    I haven't cracked open the attachment yet but I want to get the basics clear first.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    12-26-2024
    Location
    USA
    MS-Off Ver
    365
    Posts
    16

    Re: Many to Many Relationship Access DB

    What are the relationships between device-rule, variable-rule?

    Every "rule" can be made up of multiple "devices" and "variables" It's kind of like a few videos I have watched (without any luck) example... students can enroll in many classes, and classes can have many students. Same here. "rules" can have many "devices" and "variables", and "devices" and variables" can be part of many "rules" I hope that makes it clearer...

    An entity-relationship diagram would be a good start to communicate your data model.

    That is kind of what the TblConnection does. Actually, the spreadsheet you helped me with is what I'm trying to convert into a db. this is the sheet with the relationships. "rules" in "A" and "variables" and "devices" in the columns to the right. If it is easier, "devices" and "variables" can be combined in the db.

    Here is the sheet...Devices and Rules.xlsx

    Need more info????

  4. #4
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    2,924

    Re: Many to Many Relationship Access DB

    Maybe three tables for Rules, Devices, Variables with a One-To-Many relationship from the Rules to the other two.



    Then:
    a way to search a "device" and find every rule that it is associated with.
    Query Rules where DeviceID = ID from Devices

    a way to search a "variable" and find every rule that it is associated with.
    Query Rules where VariableID = ID from Variables

    a way to search a "rule" and find every "device" and "variable" associated with it.
    Join Rules, Devices and Variables on the IDs and query the Rule ID.
    Attached Images Attached Images

  5. #5
    Registered User
    Join Date
    12-26-2024
    Location
    USA
    MS-Off Ver
    365
    Posts
    16

    Re: Many to Many Relationship Access DB

    I'll give it a try. Thank you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Many to Many Relationship
    By NetherLance in forum Excel General
    Replies: 3
    Last Post: 09-15-2017, 08:29 AM
  2. One to many relationship
    By Bikashmittle in forum Excel General
    Replies: 0
    Last Post: 02-10-2017, 01:42 PM
  3. Access-style dynamic relationship table in ExCel? Possible?
    By thuppayath in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 02-04-2016, 07:05 AM
  4. Access form works with access Viewer but not full version of Access?
    By Shanyn in forum Access Tables & Databases
    Replies: 1
    Last Post: 10-22-2014, 01:14 PM
  5. [SOLVED] Idea of Access Relationship
    By boss1982 in forum Access Tables & Databases
    Replies: 15
    Last Post: 12-21-2012, 03:25 PM
  6. Access querying relationship to excel vba ?
    By datadk in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-11-2011, 03:29 PM
  7. Using Excel or Access for relationship webs
    By aspiringbodhisattva in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 03-23-2005, 01:06 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1