Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: Not showing repeated records

Not showing repeated records
"H. Martins" <HJRMartins[ at ]gmail.com> 12/30/2008 6:15:53 PM
Suppose a database where several tables are linked to a sort of top
level table: other tables 'feed' keys to the top one. I would say
almost all databases must work this way.

Now,

TableA is top

TableB and TableC feed keys to TableA, through typical associations.

Now I have a form and I want to browse TableB where [something] in
TableC.

To to that I have to include TableA in the query otherwise there is no
way to relate TableB and TableC.

The problem if that, in the browsing process, TableA takes precedence
and If one of TableB records is related in several of the TableA
records, that TableB record will show-up several times.

I am writing a report and I just need that one TableB record shows up
'once', not two or three times (as long as there is at list one
relation to TableA).

How do I do that? I hope this explanation is not to buggy .

Thanks
Henry
Re: Not showing repeated records
"BruceM" <bamoob[ at ]yawhodotcalm.not> 12/30/2008 6:37:52 PM
If you mean that tables B and C are related one-to-many from TableA, you
could use a subreport for the B and C data (one for each table, probably),
or you could group on each TableA record.

"H. Martins" <HJRMartins[ at ]gmail.com> wrote in message
news:ba7868a8-d8b7-4e68-a253-e09030e7c1ff[ at ]e1g2000pra.googlegroups.com...
[Quoted Text]
> Suppose a database where several tables are linked to a sort of top
> level table: other tables 'feed' keys to the top one. I would say
> almost all databases must work this way.
>
> Now,
>
> TableA is top
>
> TableB and TableC feed keys to TableA, through typical associations.
>
> Now I have a form and I want to browse TableB where [something] in
> TableC.
>
> To to that I have to include TableA in the query otherwise there is no
> way to relate TableB and TableC.
>
> The problem if that, in the browsing process, TableA takes precedence
> and If one of TableB records is related in several of the TableA
> records, that TableB record will show-up several times.
>
> I am writing a report and I just need that one TableB record shows up
> 'once', not two or three times (as long as there is at list one
> relation to TableA).
>
> How do I do that? I hope this explanation is not to buggy .
>
> Thanks
> Henry

Re: Not showing repeated records
"H. Martins" <HJRMartins[ at ]gmail.com> 12/31/2008 11:28:06 AM

OK.

SELECT DISTINCT

solves the problem.

I wasn't aware of the DISTINCT.

I fond the solution here:
http://groups.google.com/group/comp.databases.ms-access/browse_thread/thread/11e0710439f0cc4c/ded4d18d2d889071?lnk=gst&q=query+unique#ded4d18d2d889071

Thanks
Henry

Home | Search | Terms | Imprint
Newsgroups Reader