Restricting data entry

W

Wolfstrike

Is there a way to restrict entry of data to a field on one table
depending on what is in a column from another table..

So, my tables are:

table1
-------------
ID
upcCode
SKU

table2
-------------
ID
upcCode

So, i'm trying to make table 1 upcCode entries restricted to being
entered by only what is in table2 upcCode... any ideas?
 
J

Jeff Boyce

Rather than trying to do this directly in the tables, use forms.

Create a new form, based on your Table1. Use a combobox for your upcCode
field.

In the RowSource of the combobox, use a query against Table2. Set the
combobox's LimitToList property to Yes.

The only items that will show in the combobox (drop-down) will be valid
items from Table2.

You can also use the Relationship window to show a 1:m relationship between
these two tables.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
S

Steve

Data should be entered in table 1 with a form. Use a combobox with a row
source of table 2 to enter the upcCode on your form.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)
 
B

BonnieW via AccessMonster.com

Create a one-to-many relationship with referential integrity in
Relationships.
 
J

Jamie Collins

Rather than trying to do this directly in the tables, use forms.

I think that is the wrong advice. I think this should be done using
declarative referential integrity between the two tables (an extension
of your advice to 'use the Relationship window' -- not all
Relationships enforce referential integrity).

Jamie.

--
 

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

Similar Threads


Top