Referential Integrity

S

shep

I am using MS ACCESS 2003

Is there a way to have data in one table's field to populate a corresponding
field in another table when the field in the parent table is not the primary
key?

I have a Products table and a Transactions table. A form is based on the
Products table and a subform on the Transactions table. The Products table
has a Unit of order field (e.g., Case), a Unit of issue field (e.g., Bottle)
and a Conversion field (e.g., 12). I have a Factor field in the Transaction
table that has same value as the Conversion field. When an order is received
the subform multiplies the number of units ordered by the Factor. But I have
to enter the Factor for each order.

I want link the Factor field to the Conversion field to avoid entering the
Factor on each order.

Can I do this or will I have to create a query an create the form and
subform from the query?

Thanks
 
M

Matt Kisasonak

Yes, just make the default value of the control in the
subform equal to the value of the field or control of the
parant form. Click in the Default Value field on the
properties sheet of the control in the subform and click
the build button to use the expression builder to
reference the field or control in the parent form. You
can find it in the tree structure in the lower left
portion of the dialog box.

Matt
 
S

shep

That is great. Thank you!

Matt Kisasonak said:
Yes, just make the default value of the control in the
subform equal to the value of the field or control of the
parant form. Click in the Default Value field on the
properties sheet of the control in the subform and click
the build button to use the expression builder to
reference the field or control in the parent form. You
can find it in the tree structure in the lower left
portion of the dialog box.

Matt
 

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