Microsoft KB Archive/175217: Difference between revisions

From BetaArchive Wiki
m (Text replacement - ">" to ">")
m (Text replacement - """ to """)
 
Line 12: Line 12:
<div id="TitleRow">
<div id="TitleRow">


= <span id="KB175217"></span>ACC: Lookup Wizard Error: &quot;You Already Have a Field Named..&quot; =
= <span id="KB175217"></span>ACC: Lookup Wizard Error: "You Already Have a Field Named.." =




Line 67: Line 67:
== RESOLUTION ==
== RESOLUTION ==


Make sure that the Hide Key Column check box is not selected when you see the screen that asks &quot;How wide would you like the columns in your lookup column?&quot;<br />
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?"<br />
<br />
<br />
To create a Lookup field, follow these steps:<br />
To create a Lookup field, follow these steps:<br />
Line 75: Line 75:
# Create a second table in Design view, and add a text field named ID.
# Create a second table in Design view, and add a text field named ID.
# Add a second field named Test. In the Data Type column, click the down arrow and select the LookUp Wizard.
# Add a second field named Test. In the Data Type column, click the down arrow and select the LookUp Wizard.
# When the Lookup Wizard starts, select the default option &quot;I want the lookup column to look up the values in a table or query&quot; and then click Next.
# 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.
# On the second screen of the Lookup Wizard, under &quot;Which table or query should provide the values for your lookup column?&quot;, select Table1, and then click Next.
# 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.
# 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.
# 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.
# On the fourth screen of the Lookup Wizard, which asks &quot;How wide would you like the columns in your lookup column?&quot;, make sure that the Hide Key Column check box is not selected, and then click Next.
# 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.
# On the fifth screen of the Lookup Wizard, select Field1 in the Available Fields box, and then click Next.
# On the fifth screen of the Lookup Wizard, select Field1 in the Available Fields box, and then click Next.
# On the sixth screen of the Lookup Wizard, which asks &quot;What label would you like for your lookup column?&quot;, notice that the suggested label for the lookup column is Test. Click Finish, and then click Yes to the message that says that &quot;The table must be saved before relationships can be created. Save now?&quot;.
# On the sixth screen of the Lookup Wizard, which asks "What label would you like for your lookup column?", notice 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?".
# 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 &quot;There is no primary key defined.&quot;<br />
# 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."<br />
<br />
<br />
Note that the table is saved with the Lookup field without an error.
Note that the table is saved with the Lookup field without an error.
Line 96: Line 96:


<ol>
<ol>
<li>Repeat steps 1 through 7 in the &quot;Resolution&quot; section.</li>
<li>Repeat steps 1 through 7 in the "Resolution" section.</li>
<li>On the screen that asks &quot;How wide would you like the columns in your lookup column&quot;, make sure the Hide Key Column check box is selected, and then click Next.</li>
<li>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.</li>
<li>When you see the screen that asks &quot;What label would you like for your lookup column?&quot;, notice that the suggested label for the lookup column is Test. Click Finish, and then click Yes to the message &quot;The table must be saved before relationships can be created. Save now?&quot;.</li>
<li>When you see the screen that asks "What label would you like for your lookup column?", notice 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?".</li>
<li>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 &quot;There is no primary key defined.&quot; The field name has now been changed from Test to ID and you receive the error message:<br />
<li>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." The field name has now been changed from Test to ID and you receive the error message:<br />


<div class="errormessage">
<div class="errormessage">
Line 113: Line 113:
== REFERENCES ==
== REFERENCES ==


For more information about the Lookup Wizard, search the Help Index for &quot;Lookup Wizard,&quot; or ask the Office Assistant.
For more information about the Lookup Wizard, search the Help Index for "Lookup Wizard," or ask the Office Assistant.


</div>
</div>

Latest revision as of 11:07, 21 July 2020

Article ID: 175217

Article Last Modified on 1/22/2007



APPLIES TO

  • Microsoft Access 95 Standard Edition
  • Microsoft Access 97 Standard Edition



This article was previously published under Q175217

Moderate: Requires basic macro, coding, and interoperability skills.


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

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 select the 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?", notice 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?", notice 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." 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, search the Help Index for "Lookup Wizard," or ask the Office Assistant.

Keywords: kberrmsg kbprb KB175217