Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating existing records

Status
Not open for further replies.

david7777777777

Programmer
Sep 26, 2001
417
US
This is Access 97. I've got a table (tbl_Employees) with existing records. I've gone into that table and added a new, additional field called NewStuff, with the data type set to Text.

I've got an Excel 97 spreadsheet with one column named NewStuff. The cell format for this column is set to text. I have new information in this NewStuff column in the spreadsheet that I need to add to each existing record for each employee in the table. How do I insert/import this NewStuff data into the existing table and have the data correspond to the correct record? In other words, how do I make sure that Bob's NewStuff information in the spreadsheet is added to Bob's record in the table? Thanks.
 
Do you have the employees names in the spreadsheet? If so, you can import the spreadsheet into your Access database and then create an update query joining your tables by the employee name.

If you don't have the employee names in the spreadsheet then you will not be able to do this unless there is other fields you could use to create your join.

cew657
 
No, the spreadsheet consists of only the NewStuff data. So what's the theory behind this joining thing? Is this the only or best way to accomplish what I've described I need done?
 
David

Joining the data is pretty much the only way to do what you want in Access - how else will Access know which record to put each bit of NewStuff into? (Remember that Access, being a relational database, doesn't regard a table as having an "order").

I'd be tempted to paste your Access table (having ordered it appropriately) into Excel in columns next to your NewStuff stuff; then reimport the whole lot back into Access (having deleted all your employee records - having taken several backups before you start any of this!!). Reason being, it's usually easier to scan down a spreadsheet and check everything is correct, and put it right if not. This assumes you have (preferably substantially) less than 65,000-odd employee records...

HTH


Ben
 
Thank you, that makes sense. I thought about the exporting/re-importing solution too. Does Joining create a new table or create a new querey?
 
David

Creates a new query - or rather, you create the join in a query (which you can if you want use to create a new table). Go into query and add two tables with a common field; drag the common fieldname from one to the other; you've created a join.

HTH

Ben
 
Thakns. I guess my question should have been: What type of databse object is a Join considered to be, a table or a querey? Or is a Join a separate object in and of itself?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top