Restricting data entry

  • Thread starter Thread starter Wolfstrike
  • Start date Start date
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?
 
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
 
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)
 
Create a one-to-many relationship with referential integrity in
Relationships.
 
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.

--
 
Back
Top