Access question

  Josquius 16:53 19 Jul 05
Locked

Is there a way in access I can set a relationship whereby a field in one table can only say one thing if a filed in another table says another?
What I mean is something like one table lists the boxes in a room. Another lists what items that are in the boxes. The second one can only say the items are in box no '9' if the first says there is a box 9

  Josquius 16:59 19 Jul 05

Also while I'm at it a minor question- how do you set it so that the number in a cell must be between two numbers?

  Belatucadrus 17:24 19 Jul 05

When you create the relationship between the tables, put the tick in the "Enforce referential Integrity" box.

  Rigga 17:24 19 Jul 05

If you have it take a look at the Northwind, demo database.

Have a look at the Order Details table, paying attention to the ProductId field.

View the Table relationships, and you will see that the ProductId on the Order Details table is related to the ProductId on the Product table, and referential integrity has been enforced on the relationship.

This stops any ProductId's on the Order Details table being entered if they do not match a ProductId on the product table.

Then go back to design view of the Order Details table, and check out the lookup tab, for the field definer. This will shoe you how to get a drop down list of the (in this case) Product Id's, and hopefully in your case box numbers.

On your second q., check out validation rules within the table definer when the required field is selected, you should be able to enter in there ">0 And < 99" if you want the value between 0 and 99 for example.

HTH. R.

  Josquius 21:39 19 Jul 05

Northwind demo database?
I am unfamiliar with this....
I do not understand at all where both of you are coming from with how to do this.

I have tried
">1500 and <2000" for what I need but it does not work. What is wrong here?

  Josquius 23:04 19 Jul 05

Bumping this before sleep time...

  Muckle 23:11 19 Jul 05

The Northwind database is a sample database that usually installs with Access, but I'm not sure where you'd find it on your PC.
Which version of Office are you using?

  Josquius 23:16 19 Jul 05

2000

  Muckle 23:17 19 Jul 05

In 2003 click Help/Sample Databases/ Northwind and have a look around.

  Josquius 23:21 19 Jul 05

I don't appear to have it

  Muckle 23:35 19 Jul 05

Try looking in C:\program files\Microsoft Office\Office?\Samples
? maybe a number eg 9

This thread is now locked and can not be replied to.

iPhone 7 review: a range of small updates add up to an excellent phone

1995-2015: How technology has changed the world in 20 years

How New York’s Stylin’ Seniors became a golden social media campaign

23 Apple Watch tips & secret features: Master your Apple Watch, Apple Watch Series 1 or Apple…