Lookup question

J

JB_96RS

Having some trouble working with the following code:

Me!txtLotID1 = DLookup("[Lot]", "DataSheet",
"[BoxID]=[Forms]![frmExportToXML]![txtSUID]")

The datasheet table contains a column of BoxID numbers and a column of
LotID numbers. Several LotID's can pertain to one BoxID number. What
I want to happen is once I select a BoxID for all the LotIDs associated
with one BoxID to be displayed in seperate text boxes.
Any ideas? Any help would be greatly appreciated

JB
 
H

Howhiareu

Ideally, you would use either a subform or a listbox.

If you want to edit the list of LotID's then use a subform, it can be
easily set up to automatically fetch the correct list of LotID's when
the parent boxid is selected on the parent form. It uses the
LinkChildField and the LinkMasterFields properties of the subform
container.

You can use a listbox if all you need to do is select 1 or more LotIDs
for later use. When the boxID changes, you will need to update the
RowSource of the listbox to show the correct LotIDs
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top