ct1983
10-08-2010, 09:08 AM
i have a products table and a manufacturers table that i want to link a one-to-many relationship
however when i use the lookup wizard to in the manufacturer table and select manufacturer name in the products table it also selects the model number field to link
and when i try to do it manually in the relationships page and enforce referential integrity it says:
data in the table 'Products' violates referential integrity rules
the_net_2.0
10-08-2010, 10:05 AM
ct,
do not use the lookup wizard in the table design view. that is the worst invention ms has come up with in this program.
leave your PKs and FKs alone, set the relationships in the rel window and use lookups (if you absolutely need to) at the form and report levels only. it doesn't take that much more time to do it this way, and the future looks brighter if you do. :)
if at all possible, you should really forego lookups anywhere, because they make the data look 'unstable'. lookups usually populate the controls after the bound fields do, which sometimes makes controls 'flash'.
boblarson
10-08-2010, 10:08 AM
i have a products table and a manufacturers table that i want to link a one-to-many relationship
however when i use the lookup wizard to in the manufacturer table and select manufacturer name in the products table it also selects the model number field to link
and when i try to do it manually in the relationships page and enforce referential integrity it says:
data in the table 'Products' violates referential integrity rules
I totally agree with the_net_2.0 on this. Lookups should not be set at table level. You use combo boxes or listboxes on a FORM to lookup and then store the ID but display the TEXT DESCRIPTION.
See here (http://www.mvps.org/access/lookupfields.htm) for more about why lookups at table level are EVIL. :)