Results 1 to 4 of 4

Thread: Create sub form

  1. #1
    Join Date
    Apr 2002
    Posts
    168

    Unanswered: Create sub form

    I need to create a form that displays companies information. I have three tables : company details (name, address), company revenue and company contacts.

    So I need my form the be like this :

    Company : AAA
    Address : 123 Street

    Revenue : $100

    Contact : John
    Smith


    So if I want to add a new company, I can also add several contacts in one display.

    Can this be accomplished using subform ? If yes, how ?



    Thanks
    .

  2. #2
    Join Date
    Apr 2002
    Posts
    139
    First your Company table will need a CompanyID-field, pref. autonumber.

    Then your Contact table will need a ContactID field, also autonumber,
    Plus a second field called CompanyID, set to long integer.

    Then set the relations between the 2 tables as one-to-many.

    Create a (sub)form for your contact table.

    Create a mainform for your company, and use the wizard to include the subform for contacts. That should link pieces together.

    hth

  3. #3
    Join Date
    Apr 2002
    Posts
    168
    Thanks for the reply

    There is a thirs table, company revenue. How can I include it in the form ?

  4. #4
    Join Date
    Apr 2002
    Posts
    139
    First determine the relationship between company and revenue.
    A) Is this a one-to-one (Only one revenue for each company)?
    B) Or is it one-to-many (Several revenues for each company)?

    Case A: Consider to include the field revenue in the Company-table;
    Case B: Do the same as with your contacts table and subform.

    Your mainform Company can include two or more subforms.

    hth

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •