Results 1 to 13 of 13
  1. #1
    cboshdave is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2012
    Posts
    16

    Table relationship in subform...

    I realize this is probably a simple question, but I just cannot find the answer. I have two tables. Projects and Issues. Issues has an ID key and a Project ID that relates back to the Projects table. I have set that relationship on my Relationships window. On my main form, I select a project, then I go to the Issues subform and I add an issue... I want the Project ID to autopopulate with the Project I am sitting on. It does not. I keep ending up with an orphan issue.

    I am working from a template that already had a tasks table related to the projects. The tasks subform works fine. I have tried to go through and compare EVERY item, but apparently, I am not finding the proper value to set (or whatever causes that to occur).

    If you have an idea where I should look, I would be grateful.

    Thanks,


    Dave

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,849
    Sounds like you want to use the LinkMasterField and LinkChildField and use the ProjectID to se the link.
    I may be missing some of your details.

    Some screen shots may be helpful. Can you show us your relationships window as a jpg?

  3. #3
    cboshdave is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2012
    Posts
    16
    Click image for larger version. 

Name:	Relationship.JPG 
Views:	23 
Size:	62.3 KB 
ID:	19345
    Hope that is useable? size?

  4. #4
    cboshdave is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2012
    Posts
    16
    Quote Originally Posted by orange View Post
    Sounds like you want to use the LinkMasterField and LinkChildField and use the ProjectID to se the link.
    I may be missing some of your details.
    I found the property on the table design. Neither of these fields are set on the Task table. So, this must be handled somewhere else?

  5. #5
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,849
    No LinkFields relate to Forms/Subform.

    Your relationships are interesting.

    Why are so many fields in Project repeated in the Issues table?

    What exactly is the AssignedTo field in Issues and Tasks? Is there a difference between AssignedTo and Owner?

    You may need to repeat (add) your Employees table 2 more times. It will automatically be renamed Employees_1 and
    Employees_2. These are just for references to the EmployeeId to value these AssignedTo fields.

    You should not use special characters (% ) or embedded spaces in field names.

  6. #6
    cboshdave is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2012
    Posts
    16
    Well, I pulled this sample off the internet. Someone built the basics and it worked fine. All I wanted to do was add another table to track issues related to projects. So, I really don't want to mess with the overall too much. Just trying to add this one additional table.

  7. #7
    cboshdave is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2012
    Posts
    16
    One more bit of information. When I try to add data to my Issues Subform, I get the following error. This is clearly related. Sorry I missed it before.
    Click image for larger version. 

Name:	Access Entry Problem.JPG 
Views:	23 
Size:	25.5 KB 
ID:	19346

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    What is the RecordSource for the Issues subform - table, query, SQL statement?

    I suppose each task and issue has its own priority/status/start/end independent of the project. Might want to rename these fields to represent that. Also, advise not to use spaces and special characters/punctuation (underscore is exception) in naming convention.

    I don't think Employees table needs to be repeated in the Relationships builder because the FK fields are in different tables.

    If you want to provide db for analysis, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    cboshdave is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2012
    Posts
    16
    Yeah... I am very interested in what I am doing wrong here. I am taking your suggestion and posting the code. Thanks June7! Again, everything is working pretty well. I just want to tack in the Issues piece and have it work similar to the Tasks table. Both related to Projects.

    Your other question was, difference between owner and assigned to. Owner is the Project Owner. Assigned to relates to the task. Issues also has an Assigned to for the specific issue (risks, questions, problems, etc).

    Very simple, but helps me manage things. I have tweaked it a bit, but found it somewhere on the internet.

    Thanks,
    Dave
    Attached Files Attached Files

  10. #10
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Problem with these 'found' databases is they often do weird things that I would never do. For instance, Common Tasks form/subform have the same data source. I also do not use macros. Good thing is it's not using Navigation form/control.

    Already mentioned issues with naming convention.

    The Issues subform container control Master/Child Links properties are not set correctly. Should be:

    Master: ID
    Child: Project

    Look at the Tasks subform container control and you will see this.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  11. #11
    cboshdave is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2012
    Posts
    16
    Sorry... i am trying to find the Tasks subform container control. I am not sure where to look? It sounds like, if I can find that, I can resolve the issue. Sorry again for my lack of experience here!

  12. #12
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    It's on the ProjectTasks tab of ProjectDetails form.

    A subform is created by putting a subform/subreport container control on a form/report. The container has a SourceObject property which can be set to table/query/form/report. The container has Master/Child Links properties that synchronize the main and subform records.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  13. #13
    cboshdave is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2012
    Posts
    16
    Finally! I found it. There were a couple other small things as well, but your suggestion got me pointed in the right direction!!!! Wow, the PITA factor was high on this one! Thanks a bunch. Simple solution, but meets my needs for tracking! Sometimes simple is good!

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

Similar Threads

  1. form/subform relationship
    By vientito in forum Programming
    Replies: 7
    Last Post: 10-27-2014, 06:53 PM
  2. Subform table relationship
    By Geoffk78 in forum Access
    Replies: 7
    Last Post: 09-06-2013, 01:01 AM
  3. Replies: 4
    Last Post: 08-08-2012, 05:49 PM
  4. Form and Subform relationship
    By ZJGMoparman in forum Forms
    Replies: 1
    Last Post: 04-16-2012, 12:25 AM
  5. Replies: 0
    Last Post: 02-16-2006, 09:11 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