PLEASE HELP SIMPLE QUESTION

R

Rick

I have two tables, TBL1 and TBL2 both with the primary key
called, mach_id. I have a YES/NO field in TBL1 that I
want to be checked if that specific mach_id is present in
TBL2. If the mach_id is not present in TBL2 I do not want
a check. Does anyone know how to do this? TIA
 
R

Rick

I get an error messege that says Undefined function IF
-----Original Message-----
Rick said:
I have two tables, TBL1 and TBL2 both with the primary key
called, mach_id. I have a YES/NO field in TBL1 that I
want to be checked if that specific mach_id is present in
TBL2. If the mach_id is not present in TBL2 I do not want
a check. Does anyone know how to do this? TIA

This is a bad design. Instead of trying to store this in TBL1 you can set up a query
that will give the desired results and then not have to worry about constantly
updating TBL1 any time changes occur in TBL2.

SELECT TBL1.mach_id, IIf(IsNull([TBL2]![mach_id]), False, True) AS InTable2Test
FROM TBL1 LEFT JOIN TBL2 ON TBL1.mach_id = TBL2.mach_id


.
 

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