Set checkbox based on the value in another table

F

Fiona

I have a form bound to a table and I want to set a checkbox based on a
value in another table that is linked to this main table.

I work better with pictures so here goes:

Table1 - Products with fields for ProductID and ProductName
Table2 - Application with field for ApplicationID and ApplicationName
Table3 - Join table - fields for ProductID and ApplicationID

Table1 is the main table in the form but I want a checkbox to be
checked if the Product has a particular Application. I probably do not
need Table2 as I can hardcode the ApplicationID.

I would really appreciate it if someone could offer some advice on how
to accomplish this.

Thanks.
 
M

Marshall Barton

Fiona said:
I have a form bound to a table and I want to set a checkbox based on a
value in another table that is linked to this main table.

I work better with pictures so here goes:

Table1 - Products with fields for ProductID and ProductName
Table2 - Application with field for ApplicationID and ApplicationName
Table3 - Join table - fields for ProductID and ApplicationID

Table1 is the main table in the form but I want a checkbox to be
checked if the Product has a particular Application. I probably do not
need Table2 as I can hardcode the ApplicationID.


If I understand what you want, you can set the check box's
Control Source expression to something like:

=Nz(DLookup(True, "Table3", "ProductID=" & Me.txtProductID &
" AND ApplicationID = 123"), False)
 

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