I have a table A that contains a list of animals and a table B that contains an entry for some animals with a primary key of registration_id and a foreign key to table A. An entry in table A may have 0 to n entries in table B.
In a table A object/instance there are two fields that optionally contain foreign key links to table B for the parents of the entry. Data is entered via a form for table A. In the form for inputting the table A data, if an entry is made in each of the foreign key fields, I would like to validate that an entry exists in table B before committing the data.
I am considering creating a macro for each field that would move the key data to a hidden field on the form and then call a third macro that would query table B. My rationale is that I would have a single macro to query table B that could be used for each test.
Is this a reasonable approach to designing this?
I appreciate any comments.