Where is a Field used?

C

Chris

I have a Field located in Tbl_Inspect. The field is called Status. The
problem is that there is another field in another table that is also called
Status. This is an inherited database so I didn't set it up this way but I
would like to use both fieldds in a report and I receive an error. I think
the easiest thing to do is to rename on of the Status field. Before I do
this, I want to see if there is a way I can run a "diagnostic" of sorts to
find out where the field I want to change is used throughout the database.
Any suggestions?
 
P

Pat Hartman \(MVP\)

This is a fairly common situation in certain types of applications and
doesn't necessarily indicate poor design. For example, a table with
employees that contains a supervisor field that references the employee
table. In a query you would need two copies of the table to get both the
supervisor and employee names in your query and so you end up with two of
every column. The solution is to use alias' to disambiguate the names.

Select e1.employeeName as WorkerName, e2.employeeName as SupervisorName
From tblemployee as e1 Inner Join tblemployee as e2 On e1.SupervisorID =
e2.EmployeeID;

To do this in the grid,

WorkerName:EmployeeName -- SupervisorName:EmployeeName
e1 -- e2

Separate the alias name from the field name with a colon.
 
Top