mcnewsxp said:
MDB 2 will house all of the records thst come from outside sources. this
is part of a study. MDB 2 will contain records for al of the specimens
that are sent to a central location and will imported to MDB 2. MDB 1
will have two tables that will store test results for two different tests.
MDB 1 has a link the the table in MDB 2. the tests are performed on the
specimens that are stored in MDB 2. the table in MDB 2 and the two tables
in MDB 1 share a common ID column.
so again, when new records are imported into the table contained in MDB 2
how do i keep the two tables in MDB 1 up to date with the new common ID
column - automatically?
Again: Getting your table design right is more than half the battle: the way
you put your question makes me think there may be some issues there.
What you seem to be asking (and John has answered) is how to create new
test-result records which are empty apart from the ID of the specimen to
which they will refer. Why would you want to do that? Unless MDB2 isn't an
accumulating table of specimens but only contains the latest batch, perhaps?
If that's the case (and of course I'm guessing) then in my view it would
make more sense to append the new batch to a "permanent" table of Specimens.
Then add a new test-result record to the appropriate table when you have
some data to put in it.
It's certainly possible that I'm missing something (and I'm certainly less
qualified than John to pontificate) but the experience I do have suggests
that if you are drawn to add some "procedural" code (think Visual Basic) to
make your data model work then it's well worth re-examining your table
structure. When you add a test result, you need to be able to refer to a
specific Specimen. That doesn't mean you have to pre-populate the Results
table(s) when the specimens arrive (before they are tested). I see this as
a situation in which you'd use a form. You'd select a Specimen from the
table of available specimens, type in values for test results, and only at
that point create a new record in the Results table. You could list untested
specimens using a simple "outer join" query (which might be used to filter
specimens for selection in your form).
Phil