Help....add report in table....How?

L

LJG

Hi Guys,

Can anyone help me with this issue, I have 2 tables 'Contacts' and 'Orders'
(1 to many)

Primary key is 'contactID'

I have a form to create orders for each contact with the record source
having the following fields:

tblcontacts
contactID (autonumber)
orderID
name etc

tblorders
orderID (autonumber)
df1 (date)

The problem I have is that when I create a new record it is not adding a
record in tblorders (orderID)

Any help would be appreciated

Thanks
Les
 
J

Jeff Boyce

The typical approach to handling a 1:M relationship like yours is to use a
main form to record the "1" side data, and a subform for the "many" side
data. If you use a subform control on your main form, you can use the
Parent/Child properties to connect them. Use the primary key in the main
table, and the related foreign key in the child table.

Do NOT expect to get an empty "many" record when you create a "one". But if
you start entering a record in the subform, with subform-related data, it
will "inherit" the foreign key from the main form.
 
L

LJG

Hi Jeff,

Thnaks for the reply.

I have the forms setup as you suggest, however, when I try to save the
record, close the form, I keep getting a message that a record is required
in tblOrders, from the main form, so I assume the main form is not getting
the orderID to save in contactID

Any idea how I can over come this?

Thanks
Les
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top