By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,064 Members | 1,542 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,064 IT Pros & Developers. It's quick & easy.

Populating form controls using the DLookup function

P: n/a
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
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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


Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.