Results 1 to 3 of 3
  1. #1
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568

    Creating junction table - relationships

    Hi !



    I am trying to create junction table like here:

    Click image for larger version. 

Name:	Screenshot_28.png 
Views:	14 
Size:	105.3 KB 
ID:	34682

    This is ok because i have for all these fields references to satellite tables.

    Problem is where i want to add also FK to workload table. Because workload is characteristic only for specific Junction_ID (so It can be nullable).
    To avoid this i created relationships like here:

    Click image for larger version. 

Name:	Screenshot_30.png 
Views:	14 
Size:	72.5 KB 
ID:	34683

    and now when i am creating form there is a problem to input data. I can create something like here:

    Click image for larger version. 

Name:	Screenshot_31.png 
Views:	14 
Size:	126.0 KB 
ID:	34684
    Click image for larger version. 

Name:	Screenshot_32.jpg 
Views:	14 
Size:	102.9 KB 
ID:	34685

    but i can not insert into this.

    How can i achevie similar effect like for other tables? (FK in junction table refered to PK in satellite table).

    I can write VBA code which will be use after uptade event for choosen WorkloadName and will be inserting data into t_junctiontoworkload but i am not sure it is the best option here.
    Maybe i should put this Nullable FK in t_junction table? But with nullable i can have a lot of problems handling data integrity later - database is on postgresql BE.

    Please help,
    Jacek

  2. #2
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    If fields can be null, use outer joins for one or both links
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  3. #3
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568
    thank you workinf !!

    Jacek

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

Similar Threads

  1. Creating a junction table
    By victorythroughharmony in forum Access
    Replies: 29
    Last Post: 03-26-2018, 02:32 PM
  2. Creating New Table with Automatic Relationships?
    By bobbito in forum Programming
    Replies: 8
    Last Post: 05-10-2016, 01:58 PM
  3. Replies: 1
    Last Post: 01-27-2016, 04:30 PM
  4. Replies: 3
    Last Post: 01-21-2013, 12:57 AM
  5. Replies: 3
    Last Post: 04-27-2012, 08:34 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