Results 1 to 10 of 10
  1. #1
    dweekley is offline Advanced Beginner
    Windows XP Access 2002 (version 10.0)
    Join Date
    May 2010
    Posts
    52

    Linking Subform to Form issue

    I have created my main form I have created my subform and added it to the main form. I can enter data in both and see the data in the tables. However the subform is not displaying the data at all, never mind to the proper main record. Have been checking the links between the tables. Even when created using the wizard.



    I can go to tables and see the associated data by expanding. There all looks good.

    What am I missing?

    Thanks
    David

  2. #2
    jwhite is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Dec 2012
    Location
    North Carolina
    Posts
    349
    Does your child table have the Primary Key of the parent table in it?

    For the subform control on the main form, is Master Link set to the parent table's primary key and the Child link set to the child's field which is the primary key in the parent table?

  3. #3
    dweekley is offline Advanced Beginner
    Windows XP Access 2002 (version 10.0)
    Join Date
    May 2010
    Posts
    52
    I guess I have to say no.

    I was using created a 'EntryID' with auto number for the primary key. And attempt to choose same named fields in both tables for linking. I guess I need to change that method by removing the 'EntryID' and selecting the other field as primary.

    David

  4. #4
    jwhite is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Dec 2012
    Location
    North Carolina
    Posts
    349
    The PK in the parent table and FK in the child table can have the same field name. When building the relationship between the two tables, you would click on the field in the parent table, drag the mouse to the same field name in the child table, and release the mouse button. If you made the fields the same name, then you put that fieldname in for both Link Master and Link Child.

  5. #5
    dweekley is offline Advanced Beginner
    Windows XP Access 2002 (version 10.0)
    Join Date
    May 2010
    Posts
    52
    Thanks for the quick reply. I checked the Linked values in properties and they have the correct field name. Have gone thru the steps again and still nothing in the subform. Yet in the Parent table I can expand and see the associated records. Done this before, yet some time ago. Missing something foolish I'm sure.

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Can you post a copy of your database ?
    You might get some ideas from this free youtube from Dr. V.
    There are other youtube videos on the subject.
    Good luck.

  7. #7
    dweekley is offline Advanced Beginner
    Windows XP Access 2002 (version 10.0)
    Join Date
    May 2010
    Posts
    52
    Thanks for the info. Heading there now. I attached a copy. The main table and form are 'f_estimate' and child is 'f_estimate_op'
    Attached Files Attached Files

  8. #8
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Tell us more about your business. Where do estimates and estimateops fit?
    Most of your tables do not appear in your relationships window, why?

    You build your database structure based on the business rules/facts.
    It is not clear to me what your database is about, nor what your tables represent in business terms (simple English).

  9. #9
    dweekley is offline Advanced Beginner
    Windows XP Access 2002 (version 10.0)
    Join Date
    May 2010
    Posts
    52
    Machine Shop. The operation_process table will contain all operations and outside service offered. The estimate is the initial layout for a part in which a job will be performed.

    How ever I believe I found my error. I heard the word query and then realized I never created one. Was merely linking the tables. So I created the query, then created the subform based on that query. All is looking good so far.

    For the subform to display the records vertically I am guessing you can only do that using Datasheet? And if so, can the column header be hidden. I typically do not name the fields in the table so they have a clear meaning to a user. Used to using labels for that.

    David

  10. #10
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    The original problem with the sub form was because the sub form was in Data Entry Mode. Data Entry Mode displays only one record and is a NEW record; since it is a new record, existing records will NOT be displayed.

    I also would not design the tables the way they are now.
    Three tables have the SAME PK field name and two tables have the SAME PK field name:
    Click image for larger version. 

Name:	dweekley1.jpg 
Views:	14 
Size:	61.4 KB 
ID:	28462
    Plus, the linking fields are text fields.
    See
    Microsoft Access Tables: Primary Key Tips and Techniques
    http://www.fmsinc.com/free/newtips/primarykey.asp


    I would change the table structures to something like:
    Click image for larger version. 

Name:	dweekley2.jpg 
Views:	13 
Size:	65.6 KB 
ID:	28463
    Note that the customer table is now linked....


    Also note that "Description", "Size" and "Version" are reserved words and shouldn't be used as object names.



    Granted, I know nothing about your dB or requirements, but take a look at the modified dB....
    Attached Files Attached Files

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

Similar Threads

  1. Error when linking subform to form
    By N7925Y in forum Forms
    Replies: 12
    Last Post: 10-07-2016, 01:44 PM
  2. Subform linking issue
    By buckwheat in forum Access
    Replies: 3
    Last Post: 08-28-2013, 01:53 PM
  3. Replies: 15
    Last Post: 03-05-2013, 11:57 PM
  4. Form - subform linking problem
    By Justin in forum Access
    Replies: 1
    Last Post: 11-11-2010, 11:21 AM
  5. Linking Subform Control to Main form
    By KWarzala in forum Forms
    Replies: 1
    Last Post: 03-13-2010, 08:32 PM

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