Limit lookup results by relation to current record

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!
 
L

Larry Linson

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
 

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