Results 1 to 2 of 2
  1. #1
    lizzywu is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    41

    Link main form with subform

    I am trying to use subform to link two tables and enter data. In the first table, “tpat”, the primary key is subject_id, for which I use 5-digit autonumber (10001, 10002, …10010, 10011,…). The second table called “tcontact_tracking” has the primary key “track_id”. I tried to generate the number for “track_id” based on “subject_id”, so that for each subject, there can be a sequence of track_id; for example, for subject 10001, there are track #1000101, #1000102,…1000110, 1000111,…



    Also, in the form (fpat_tracking), I want the subform (fcontract_tracking) to be grouped by subject_id, and in this way if I want to look at the track records of each subject, the main form shows the subject information and the subform shows the corresponding tracking information.

    Coding is always a hardest part to me. Although I’ve got some suggestion earlier, my coding didn’t work out. I attach the database I have so far here. I was wondering whether some of you can help me out.

    Appreciate any help.
    Last edited by lizzywu; 11-18-2011 at 11:09 AM.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Master/Child link properties of the subform container control are wrong. Must link on the subject_ID fields of both tables. Subject_ID in tcontact_tracking needs to be number datatype.

    Track_id in tcontact_tracking needs to be Autonumber or you will have to manually enter the value.
    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.

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

Similar Threads

  1. Replies: 3
    Last Post: 11-16-2011, 01:56 PM
  2. Totals from subform to main form
    By kathi2005 in forum Forms
    Replies: 4
    Last Post: 11-04-2011, 10:19 AM
  3. Replies: 2
    Last Post: 08-01-2011, 11:35 PM
  4. Controlling Subform from Main Form
    By SteveF in forum Forms
    Replies: 5
    Last Post: 07-01-2011, 05:32 PM
  5. Subform won't display in main form
    By Lynn in forum Forms
    Replies: 15
    Last Post: 03-22-2010, 10:17 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