A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Replace values with a foreign key.



 
 
Thread Tools Display Modes
  #1  
Old August 24th, 2009, 03:01 AM posted to microsoft.public.access.gettingstarted
Gluefoot
external usenet poster
 
Posts: 16
Default Replace values with a foreign key.

Hi everyone, fairly new to Access. I have a table "TRACKING" with a column
that has USER_NAMES. There are about 3000 records in this table. I'd like to
replace the names in this user name column with a USER_ID that is a primary
key on a new USER table, is there a quick way to do this in Access?

Thanks in advance for help.
  #2  
Old August 24th, 2009, 05:31 AM posted to microsoft.public.access.gettingstarted
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Replace values with a foreign key.

On Sun, 23 Aug 2009 19:01:01 -0700, Gluefoot
wrote:

Hi everyone, fairly new to Access. I have a table "TRACKING" with a column
that has USER_NAMES. There are about 3000 records in this table. I'd like to
replace the names in this user name column with a USER_ID that is a primary
key on a new USER table, is there a quick way to do this in Access?

Thanks in advance for help.


Not real quick but it certainly can be done. Are the names unique or repeated?
How are they stored - "John V. Doe" in the USER_NAMES field (not ideal) or
fields such as FirstName, LastName, MiddleName? do you already have a new USER
table or are you trying to create one?

In essence, what you'll need is to create a new USER table with a UserID
primary key, probably an autonumber, and run an appropriate Append query to
migrate data from the USER_NAMES field. What's appropriate depends on what's
now in the field... examples would be helpful.
--

John W. Vinson [MVP]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:18 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.