Microsoft Knowledge Base Email Alertz

(197111) - When you use the Lookup Wizard to create a field that looks up or lists values from a table, and the first field name in the lookup table has the same field name as the Lookup field that you are creating, you may receive the error message: You already...

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 197111 - Last Review: June 28, 2004 - Revision: 2.0

ACC2000: Lookup Wizard Error: You Already Have a Field Named...

This article was previously published under Q197111
Moderate: Requires basic macro, coding, and interoperability skills.

On This Page

SYMPTOMS

When you use the Lookup Wizard to create a field that looks up or lists values from a table, and the first field name in the lookup table has the same field name as the Lookup field that you are creating, you may receive the error message:
You already have a field named <'fieldname'>
if you click to select the Hide Key Column check box when you create the field.

RESOLUTION

Make sure that the Hide Key Column check box is not selected when you see the screen that asks How wide would you like the columns in your lookup column?

To create a Lookup field, follow these steps:
  1. Start Microsoft Access and open the sample database Northwind.mdb.
  2. Create a new table in Design view, and add a Text field named Field1. Save the table as Table1, and click Yes when prompted if you want to create a primary key now.
  3. Create a second table in Design view, and add a Text field named ID.
  4. Add a second field named Test. In the Data Type column, click the down arrow, and then click LookUp Wizard.
  5. When the Lookup Wizard starts, select the default option I want the lookup column to look up the values in a table or query, and then click Next.
  6. On the second screen of the Lookup Wizard, under Which table or query should provide the values for your lookup column?, select Table1, and then click Next.
  7. On the third screen of the Lookup Wizard, move both fields under Available Fields to the Selected Fields box by clicking the >> button, and then click Next.
  8. On the fourth screen of the Lookup Wizard, which asks How wide would you like the columns in your lookup column?, make sure that the Hide Key Column check box is not selected, and then click Next.
  9. On the fifth screen of the Lookup Wizard, select Field1 in the Available Fields box, and then click Next.
  10. On the sixth screen of the Lookup Wizard, which asks What label would you like for your lookup column?, note that the suggested label for the lookup column is Test. Click Finish, and then click Yes to the message that says that The table must be saved before relationships can be created. Save now?
  11. In the Save As dialog box, click OK to save the table with the default name Table2, and then click No when you see the message There is no primary key defined.

    Note that the table is saved with the Lookup field without an error.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Repeat steps 1 through 7 in the "Resolution" section.
  2. On the screen that asks How wide would you like the columns in your lookup column, make sure the Hide Key Column check box is selected, and then click Next.
  3. When you see the screen that asks What label would you like for your lookup column?, note that the suggested label for the lookup column is Test. Click Finish, and then click Yes to the message The table must be saved before relationships can be created. Save now?
  4. In the Save As dialog box, click OK to save the table with the default name Table2, and then click No when you see the message There is no primary key defined. Note that the field name has now been changed from Test to ID, and you receive the error message:
    You already have a field named "ID."

REFERENCES

For more information about the Lookup Wizard, click Microsoft Access Help on the Help menu, type create a field that looks up or lists values intables in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

APPLIES TO
  • Microsoft Access 2000 Standard Edition
Keywords: 
kbprb KB197111
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate