Referential Integrity From Two Table Sources?

Bubbis Thedog

Well-known Member
Joined
Jul 29, 2004
Messages
967
Hello,

I was wondering if it was possible in Access to have one field in a 'hub' (main) table whose values are restricted by those in two different tables. The two other tables are static, and the 'hub' field I would like restricted only to the unique IDs in those tables.

Is this possible only by restricting the 'hub' field criteria according to the values allowed in the two static tables?

Any help would be greatly appreciated!
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
If the "hub" field is not a key field, and you are using a form for data entry, you could try building a Union query as the Row Source for a combo box.
So...
In the combo, set the Control Source to the field tht you want to populate.
In the Row Source, click the blank row and hit the Builder (...) button to open the query grid. Now,select View | SQL view. You'll need to type something along these lines:
SELECT * FROM [Table1].[Field1Name] UNION SELECT * FROM [Table2].[Field2Name] ;
Closethe query, save when prompted and try it out.

Alternatively, if the other fields are not changing (they're static, right?) you could biuld a query like the above to ectract the values, then use a Make-Table query to push that into a new table with a single field. You could then base the combo on this field.

Denis
 
Upvote 0
Thanks for the great input, SydneyGeek. I'll give your solution a shot and (hopefully) post the results.
 
Upvote 0

Forum statistics

Threads
1,221,864
Messages
6,162,497
Members
451,770
Latest member
tsalaki

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top