Jeff Cox wrote:
> hilz wrote:
>> Hi.
>> I asked this question before, and did not get any answers.
>> I hope someone will answer me this time!
>>
>>
>> I have the following two tables:
>>
>> CONTRACT
>> ********
>> ID (primary key)
>> CUSTOMER_ID1 (foreign key)
>> CUSTOMER_ID2 (foreign key)
>> CUSTOMER_ID3 (foreign key)
>> AMOUNT
>> some more columns...
>>
>>
>> CUSTOMER
>> ********
>> ID (primary key)
>> NAME
>> some more columns...
>>
>>
>>
>> I have a relation many-to-one from each of the three
>> CONTRACT.CUSTOMER_IDs to CUSTOMER.ID.
>>
>> So each contract can have up to three customers.
>>
>> I am having trouble displaying the customers in a contract form.
>> I tried with a subform but that does not work.
>> what can i do to display those three customers in the contract form?
>>
>> thanks
>
> First, I suggest that you remove the Customer_ID from the first table.
> Then add a Contract_ID to the Customer Table. This will allow for more
> than 3 customers if that ever happens.
>
> Then build a form based on the Contract table. Add a subformcontrol to
> the mainform with the Customer table as the recordsource. Make this
> visible in Datasheet view if you like. Link them master-child as ID and
> Contract_ID.
>
> This will show all the customers in the subform when they contain the
> same Contract ID as the contract ID in the mainform.
>
> Hope this helps,
>
> Jeff Cox
But if I do that, then i will not be able to have more than one contract
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9966
for any given customer.
Ideally, I can have a join table that allows a many-to-many relation.
but that is an overkill, and will probably complicated the situation. I
don't really need more than 3 customers per contract, and I don't see
the need for that in my business process.
Actually, I am trying to create a report and not a form (I made a
mistake by saying a form), but it shouldn't be that much different i guess.
So after the subreport approach failed, I tried to create text boxes to
display properties of every customer, but i was not able to create a
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9966
query that can look up the values from the customer table based on a
given CONTRACT.CUSTOMER_IDx because the textbox "Control Source" allows
me to enter expressions and not queries.
I am sure I am missing something somewhere.
I hope someone can help!
thanks
the source