John,
You will need to actually add the database records to add your tests
to the subform. The difference here is that in your main form, you
are adding a value to the control with the DLookup function but the
record does not exist. Only when you navigate off the record does
Access create the record. Assuming you have a relationship between
your sample and tests tables, you can not use DLookup to populate test
records without first creating the sample record. Even then, you
would only be able to use DLookup on the first test record (i.e.
before the record exists). You really need to use VBA code to
automatically add the test records as soon as the sample record is
created. That's a pretty common technique in any laboratory
information management system (LIMS). Take a look at the demo on our
web site. It may give you some more ideas on how to approach this
task. HTH
Rick Collard
www.msc-lims.com
On 3 Dec 2003 14:25:25 -0800,
jr********@comcast.net (John Hargrove)
wrote:
I am building a database to manage test samples in an environmental
laboratory. I am learning Access as I go and don't know much about
the programming aspects. I hope to make the application user-friendly
for the sample login people by populating form controls. Using the
DLookup function, I am able to populate a form control in one record
using table data. I want to be able to populate multiple records of a
subform control (test parameters) based on a control selection on the
parent form (clients), assuming this is possible. The relationships
between clients and their respective test parameters are established
in a data table. I apologize if this question is redundant.
John