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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to reference value between columns?

Status
Not open for further replies.

Spyder757

Technical User
Aug 29, 2002
129
US
I've got a text file that contains data in the following format:

ID START END COMMENT
01 9am 12pm Login
12pm 1pm Lunch
1pm 5pm Logout
02 7am 11am Login
11am 12am Lunch
12am 4pm Logout

Now I would like to import this file and write the ID to each column found in the data for example for the ID01 I’d like to end up with:

ID START END COMMENT
01 9am 12pm Login
01 12pm 1pm Lunch
01 1pm 5pm Logout

Any ideas how I can pull this off?
 
I would make sure the import contains an autonumber field so that you can maintain the order of the imported records. Assuming the autonumber field is name AutoPK you could create an update query like:
UPDATE tblTextImport SET tblTextImport.ID = DMax("ID","tblTextImport","AutoPK <=" & [AutoPK])
WHERE ID Is Null;


Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top