check if there are child records in other tabels print something

S

subzizo

Hi All ,I want code that can be used in a form to check if there is any child
records in another table that references the current record ID if yes print
the current record withe the word yes if no records print the current record
with NO references

also i need a free references that i can use to learn access programming ?

Thank you for your efforts
 
S

subzizo

Hi All ,I want code that can be used in a form to check if there is any child
records in another table that references the current record ID if yes print
the current record withe the word yes if no records print the current record
with NO references

also i need a free references that i can use to learn access programming ?

Thank you for your efforts
 
M

Marshall Barton

subzizo said:
Hi All ,I want code that can be used in a form to check if there is any child
records in another table that references the current record ID if yes print
the current record withe the word yes if no records print the current record
with NO references


You can use DCount to check the other table:

=IIf(DCount("*", "childtable", "FK = " & PK) > 0, "Yes",
"No")

where FK is the foreign key field in the child table and PK
if the primary key field in the parent table.
 
Top