creating a one to many relationship based subform

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fartash
    New Member
    • Jul 2008
    • 10

    creating a one to many relationship based subform

    i have a personnel information database and i want to modify it and want to create and add subform to this databese which will include information about the courses attended by a person

    thank you
  • Echidna
    New Member
    • Jan 2008
    • 53

    #2
    Hi,

    If you create a separate table within the database containing the columns required and add a column to the new table which will reference (preferrably the primary key) a unique identifier from the personnel table.

    This will allow the subform to filter data for the Person currently selected and display the courses.

    You will have to set the Foreign key constraint within the relationships window as one on the personnel side and many on the courses side.

    When you create the form and place it, you can set the master / child filter.

    I am making an assumption that the subform will reside within the main form...

    Select the Child object (the subform)

    under the data tab, set the Master and Child Fields.

    In master, select the PK (or identifier) column name from the Personell table.
    In child, select the FK (or identifier) column name from the Courses table.

    Hope this helps

    Cheers

    Leon

    Comment

    • fartash
      New Member
      • Jul 2008
      • 10

      #3
      thanks a lot leon i will try this and let you know again thanks a lot

      Comment

      • fartash
        New Member
        • Jul 2008
        • 10

        #4
        hi

        i tried but i am having problem defining relationships the case is that i have a database without a primary key though its a six thousand member database but i have not used primary key and the reason is that i have given each member a unique id number but many of the members have different job designation but there id numbers sometime matches to solve this problem i have given first letter of a person's job designation to his id number( like 3434/s) if i make a relationship of id number there will be duplicate error

        hope my message will make some sense if it does not forgive me

        any help be be appreciated

        thanks

        Comment

        • TheSmileyCoder
          Recognized Expert Moderator Top Contributor
          • Dec 2009
          • 2322

          #5
          Add a Autonumber column to your Persons table, and make it primary key. Thats EXACTLY why autonumber columns are made. They are always unique within the database.

          Comment

          • fartash
            New Member
            • Jul 2008
            • 10

            #6
            lets see

            thanks

            Comment

            • fartash
              New Member
              • Jul 2008
              • 10

              #7
              Hi friends

              i have tried every thing at my best knowledge ITS NOT WORKING FOR ME
              i need to add a subform to a already working database and that subform should show the courses attended by a person.

              any detailed help will be so appreciated.

              there are some point i must mention

              1 - this is ONE TABLE BASED database.

              2 - present database has a automunber field which has not been set as a PRIMARY KEY.

              3- i don't see any relationships in relationship pane.

              thanks

              Comment

              Working...