List Box

  • Thread starter Thread starter Steve Marsden
  • Start date Start date
S

Steve Marsden

If have two tables linked with an ID field. I have a form linked to the
first table.
I now want to have a list box which contains values from the second table
only where the ID field in the second table is equal to the ID field of the
current record of the first table. i.e. the record I am currently viewing in
the form.

I have tried all join types but none seem to give me the records in the
second table for just the current record I am on in the main table.

How can I do this or is it not possible with the recordsource property and I
have to fill the list box myself.
 
Steve,
Set the ListBox RowSource in the Current event of the form.

ListBoxName.RowSource = "Select [SomeField] from Table2 Where [RecordID] = "
& Me!RecordID

The above assumes [RecordID] is a number datatype.
Change the Field and Table names above to whatever the actual names are.
 
Back
Top