var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
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
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 ?
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.
Thanks for the reply
There is a thirs table, company revenue. How can I include it in the form ?
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.