Relating a field in a table to another field in the same table

A

Amer

I have a table on employees details. In the table, a field representing the
ID number of the employee's manager is linked to the primary key field of a
copy of the same table (captioned: Managers).

However, whenever I create a new form or report based on a query combining
the two Employee IDs or relevant infomation I get a message like this:

The specified field '[tabContactInfo.' could refer to more than one
table listed in the FROM clause of your SQL statement.

How to solve this issue?

Thank you all...
 
A

Allen Browne

In query design view, you have 2 copies of the same table.
One is called tabContactInfo; the other is aliased as Managers.

Design the SQL statement so that only the Email field from one field is
returned, e.g. tabContactInfo.Email. If you need the Email field from the
other table, alias it by typing another name and a colon before the field
name in the Field row in query design, e.g.:
ManagerEmail: Managers.Email

Do not use the wildcard with both tables.

If you are still stuck, post a followup with the SQL statement (SQL View of
the query.)
 
A

Amer

That worked allright... thank you

Allen Browne said:
In query design view, you have 2 copies of the same table.
One is called tabContactInfo; the other is aliased as Managers.

Design the SQL statement so that only the Email field from one field is
returned, e.g. tabContactInfo.Email. If you need the Email field from the
other table, alias it by typing another name and a colon before the field
name in the Field row in query design, e.g.:
ManagerEmail: Managers.Email

Do not use the wildcard with both tables.

If you are still stuck, post a followup with the SQL statement (SQL View of
the query.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Amer said:
I have a table on employees details. In the table, a field representing the
ID number of the employee's manager is linked to the primary key field of
a
copy of the same table (captioned: Managers).

However, whenever I create a new form or report based on a query combining
the two Employee IDs or relevant infomation I get a message like this:

The specified field '[tabContactInfo.' could refer to more than one
table listed in the FROM clause of your SQL statement.

How to solve this issue?

Thank you all...[/QUOTE]
[/QUOTE]
 

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