Assume Table A and Table B have the following fields:
Table A
[tt]AIndex
AName
AAddress
AMemo
etc.
[/tt]
Table B
[tt]BIndex
AIndex
BCode[/tt]
With obviously multiple entries in Table B for each entry in Table A
I have a form that displays all of the records of Table A. On the form is a subform that displays any [tt]CodeB[/tt] that appears in Table B for that record.
I want to be able to filter the main form for all records for which there exists a matching record in Table B where [tt]BCode[/tt] is equal to any of several numbers, say 100 or 101. But I only want each record to show up only once since the multiple Table B values will show up in the subform.
Normally, you would do this with a SELECT DISTINCT statement similar to the following
[tt]SELECT DISTINCT [Table A].*
FROM [Table A] LEFT JOIN [Table B]
ON [Table A].AIndex = [Table B].AIndex
WHERE (([Table B].[BCode] = 100) OR
([Table B].[BCode] = 101));[/tt]
But you can't do that if any record in Table A is of type Memo. Any other ideas on how to do that? Jonathan
________________________________________
It is not fair to ask of others what you are unwilling to do yourself.
-Eleanor Roosevelt
Table A
[tt]AIndex
AName
AAddress
AMemo
etc.
[/tt]
Table B
[tt]BIndex
AIndex
BCode[/tt]
With obviously multiple entries in Table B for each entry in Table A
I have a form that displays all of the records of Table A. On the form is a subform that displays any [tt]CodeB[/tt] that appears in Table B for that record.
I want to be able to filter the main form for all records for which there exists a matching record in Table B where [tt]BCode[/tt] is equal to any of several numbers, say 100 or 101. But I only want each record to show up only once since the multiple Table B values will show up in the subform.
Normally, you would do this with a SELECT DISTINCT statement similar to the following
[tt]SELECT DISTINCT [Table A].*
FROM [Table A] LEFT JOIN [Table B]
ON [Table A].AIndex = [Table B].AIndex
WHERE (([Table B].[BCode] = 100) OR
([Table B].[BCode] = 101));[/tt]
But you can't do that if any record in Table A is of type Memo. Any other ideas on how to do that? Jonathan
________________________________________
It is not fair to ask of others what you are unwilling to do yourself.
-Eleanor Roosevelt