Reputation: 765
Running MS Access 2016. Say I have a table "Models" with the following columns:
No single field is unique, but together there should only be one combination. My problem is that when I'm running a query, I can get data from these columns and alter one of the fields to something that is not valid. I don't want to run validation on the table, as I tihnk there is a more simple solution to this.
For example, if the model is "Macbok Air" and the brand is "Apple", I shouldn't be able to change the brand to anything else in the query with the lookup combo box.
I hope this makes sense, help appriciated.
A quick google search showed this reply: ". If the controlsource of the combo is a field in the forms' Recordsource then selecting a value in that combo will change the value for that field for the current record. If you want to use the selected name tin the combo to filter the form or another form, you need to leave the combo Unbound (blank Controlsource)
You can still reference the value in the combo as long as the form is open."
However, I'm not exactly sure how to do this. And I'm not using forms yet. Can anyone elaborate?
Upvotes: 0
Views: 60
Reputation: 55831
if the model is "Macbok Air" and the brand is "Apple", I shouldn't be able to change the brand to anything else
But that is a business rule only humans (you) know of. The database can have no idea, that an "Apple Surface 4" should not be a valid combo.
Your only method would be to maintain a manually validated table with valid combinations, and then let the user select an ID of these combos in one or more levels.
Upvotes: 1