Establishing relationship necessary with lookup table?

R

rovelet

Because of a search on the web, I now know why I have been
encountering problems with queries in the few databases I have made:
due to using the lookup table wizard in tables.

If I understand correctly one should create a combo box, in a form,
that will be used to choose data from a lookup table (or a query based
on the lookup table). The chosen data is then used as input in the
intended field (being a text field instead of a lookup field) of the
table underlying the form.

If this is the case, is it necessary to relate the lookup table to the
table underlying the form and why?
 
R

Rick Brandt

Because of a search on the web, I now know why I have been
encountering problems with queries in the few databases I have made:
due to using the lookup table wizard in tables.

If I understand correctly one should create a combo box, in a form,
that will be used to choose data from a lookup table (or a query based
on the lookup table). The chosen data is then used as input in the
intended field (being a text field instead of a lookup field) of the
table underlying the form.

If this is the case, is it necessary to relate the lookup table to the
table underlying the form and why?

Necessary? No. Correct? Yes. Why? Because there is a relationship in the data,
therefore your database should reflect that.
 
J

John W. Vinson

If this is the case, is it necessary to relate the lookup table to the
table underlying the form and why?

It's a good idea, because having the relationship ensures that the
data integrity is maintained between the two tables. If you have a
relationship, you'll get an error message if you attempt to delete a
record from the lookup table if doing so would leave "orphans" in the
main table, or if someone bypasses your form and tries to enter an
invalid value into the foreign key field.

John W. Vinson [MVP]
 
R

rovelet

It's a good idea, because having the relationship ensures that the
data integrity is maintained between the two tables. If you have a
relationship, you'll get an error message if you attempt to delete a
record from the lookup table if doing so would leave "orphans" in the
main table, or if someone bypasses your form and tries to enter an
invalid value into the foreign key field.

John W. Vinson [MVP]

Thank you so very much for the clarification.
 

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