Limit lookup results by relation to current record

  • Thread starter Thread starter RobertB
  • Start date Start date
R

RobertB

Hi,

I've got a database with three tables, A, B, C.

Table A has an ID field and a name
Table B has a field related to table A ID and a value lookup to table C
Table C has a field related to table A ID and a value field

When presenting table B's subform, I want to limit a combo box drop down to
only those records in table C that are related to the record in table A that
the person is currently editing. I can't seem to solve that. I can easily
include all of the records in table C in the drop down, but not limit it to
what's related to the current record in table A.

Thanks!
 
RobertB said:
Hi,

I've got a database with three tables, A, B, C.

Table A has an ID field and a name
Table B has a field related to table A ID and a value lookup to table C
Table C has a field related to table A ID and a value field

When presenting table B's subform, I want to limit a combo box drop down
to
only those records in table C that are related to the record in table A
that
the person is currently editing. I can't seem to solve that. I can
easily
include all of the records in table C in the drop down, but not limit it
to
what's related to the current record in table A.

The query you use for the Combo Box row source must refer to a field on the
form that contains the ID of the record currently being displayed in its
Criteria. You may (or may not, I'm too lazy right now to check) have to
Requery the Combo in the Form's Current event.

Larry Linson
Microsoft Office Access MVP
 
Back
Top