Many to many relationship but with exceptions (1 Viewer)

jaryszek

Registered User.
Local time
Today, 02:46
Joined
Aug 25, 2016
Messages
756
Hi,

i want to ask you about exceptions and model tables as many to many relationship with junction table like below:



So specific CustomerTopoSysVersion can have multiple SystemVersions and each of SystemVersion can have multiple OSes.

But i have exceptions here.
Sometimes instead of CustomerTopoSysVersion --> SystemVersions --> OperatingSystems i can have
CustomerTopoSysVersion --> OperatingSystems (not every CustomerTopoSysVersion will have SystemVersion, sometimes i have to skip it)

How do you handle with this kind of situation?
Are you using some kind of artificial string for SystemVersion like "NoMatch" in junction table or something like that or you have another solutions?

Please help,
Jacek
 

Attachments

  • Screenshot_12.png
    Screenshot_12.png
    37.4 KB · Views: 256

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 04:46
Joined
Feb 28, 2001
Messages
27,140
The U.S. Navy faces a problem like that for the people in this world who have no middle name. They include "(NMN)" as the middle name in any computer records for that person so that the reader who is familiar with Navy ways will see that as (no middle name). I guess you could use "(NVN)" for (no version number)?
 

jaryszek

Registered User.
Local time
Today, 02:46
Joined
Aug 25, 2016
Messages
756
Thank you The_Doc_Man.

i can even leave here nulls values but i do not think it is good approach. Is it?

The problem is when i am building main form and subforms i can not see related record to subform when systemVersion is empty.

I create example in attachment.
I am adding for CustomerTopology3 Oeratingsystem like here:



as you can see junction table (operating system field) was fullfilled with nullable key for CustomerTopoSysVersionID:



what i have here is the issue that i will not see this variables when i will refresh form:




I do not why. Maybe some people here are using this method to create forms and subforms?

Please help,
Jacek
 

Attachments

  • Screenshot_13.png
    Screenshot_13.png
    90 KB · Views: 237
  • Screenshot_14.png
    Screenshot_14.png
    91.6 KB · Views: 225
  • Screenshot_16.jpg
    Screenshot_16.jpg
    51.4 KB · Views: 106
  • Database18.accdb
    528 KB · Views: 113

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 04:46
Joined
Feb 28, 2001
Messages
27,140
I'm a little skeptical of using nulls in that context. I don't think a relationship can be established through a null field. But have to admit I have not tried it.
 

plog

Banishment Pending
Local time
Today, 04:46
Joined
May 11, 2011
Messages
11,638
Sometimes instead of CustomerTopoSysVersion --> SystemVersions --> OperatingSystems i can have
CustomerTopoSysVersion --> OperatingSystems


That doesn't make sense. Normally ( and in this case) junction tables aren't real things, unlike other tables that represent real life entities, junction tables exist to sort out data between other real entity representing tables.



Your system version table contains no real unique data unto itself. It simple connects data from Topsysversiin to Operating systems. The only reason to have data in system version is to link data in the other two tables.

System version simple acts as a traffic cop directing data between this two other tables, it doesn't add any real data itself.
 

isladogs

MVP / VIP
Local time
Today, 10:46
Joined
Jan 14, 2017
Messages
18,209
Jacek
As a null cannot be compared to anything including another null, you cannot use null values in a relationship to get meaningful output.
Once again I suggest you re-read the threads on nulls from earlier this year as you are largely covering ground that was thoroughly discussed before.
 

Cronk

Registered User.
Local time
Today, 19:46
Joined
Jul 4, 2013
Messages
2,771
I faced a similar problem when I was asked by a large local government authority to set up a system to manage the issue of permits for organizations/companies and individuals wanting to use public land for events or commercial activities.


Either the permit was associated with the organization which in turn had an employee/member as the contact, or with an individual in their own right.


I stored two foreign keys in the permits table, OrganizationID and ContactID and created a "dummy" organization "Not Applicable". Selecting an Organization did filter the Contacts combo, except when N/A was chosen.
 

jaryszek

Registered User.
Local time
Today, 02:46
Joined
Aug 25, 2016
Messages
756
Hi Guys,

thank you for your help.

Colin -
Please read this:

https://stackoverflow.com/questions/7573590/can-a-foreign-key-be-null-and-or-duplicate

Foreign key can be null but in Access maybe not?

I faced a similar problem when I was asked by a large local government authority to set up a system to manage the issue of permits for organizations/companies and individuals wanting to use public land for events or commercial activities.


Either the permit was associated with the organization which in turn had an employee/member as the contact, or with an individual in their own right.


I stored two foreign keys in the permits table, OrganizationID and ContactID and created a "dummy" organization "Not Applicable". Selecting an Organization did filter the Contacts combo, except when N/A was chosen.

This is a good answer and i think the best here - i can use isntead of nullable fill TEXT string like "Not Applicable" or "NoMatch" or something like this. Later when query is used i can easy get proper results.

That doesn't make sense. Normally ( and in this case) junction tables aren't real things, unlike other tables that represent real life entities, junction tables exist to sort out data between other real entity representing tables.

Your system version table contains no real unique data unto itself. It simple connects data from Topsysversiin to Operating systems. The only reason to have data in system version is to link data in the other two tables.

System version simple acts as a traffic cop directing data between this two other tables, it doesn't add any real data itself.

This is very important what you are writing here plog.
Can we go more into details? - i am not catching this.

I have SystemVersionOS - this is my junction table.


Best,
Jacek
 

Attachments

  • Screenshot_18.png
    Screenshot_18.png
    91.8 KB · Views: 176

plog

Banishment Pending
Local time
Today, 04:46
Joined
May 11, 2011
Messages
11,638
Ugh. When you want to discuss technical issues, especially with people not familiar with your technical details you can't casually reference items.

Your Initial post referenced "SystemVersions" in the text and had a tblSystemVersionOS in the image. Naturally I assumed they were the same thing. Now you have an image with tblSystemVersionOS as well as tblSystemVersion. I am now thoroughly confused. No idea what you mean when you use "SystemVersion" in your explanation.

Hopefully others do and can help.
 

jaryszek

Registered User.
Local time
Today, 02:46
Joined
Aug 25, 2016
Messages
756
thank you plog,

no, other explanation is not needed. Cronk helped me!!!

Best,
Jacek
 

Users who are viewing this thread

Top Bottom