check box problem

mcgooie

Registered User.
Local time
Today, 16:51
Joined
Sep 12, 2006
Messages
11
I have a checkbox on a form (ClientDetails). the form also contains text boxes for "ClientID" and "ClientName". The values for these come from a table called 'clients'

I want the checkbox to be TRUE if the ClientName on the form appears in the "Client Name" field of another table called 'links'.

I used the following code in the ControlSource, however the check box appears 'blacked out'.

Code:
=IIf([ClientName]=[links]![Client Name],True,False)

Any ideas?
 
Try using the Dcount() function with the "other" table as your domain.
You must supply 3 parameters in this function:

e.g. Dcount("[fieldName]","tablesource","your condition")

Basically, if the dcount() results in >0, then it would indicate that
the item is present in the other table. You can then set the value
of your checkbox to true or -1.

Read the access help on dcount() and see if you can make it work.
 

Users who are viewing this thread

Back
Top Bottom