Import from txt file

G

Guest

Hello,

I have a text file that I create from a spreadsheet that has data
formatted as such:

First,Last,Date,StartTime,StopTime

I want to import the data into an existing table in access with the
following format:

ScheduleID,EmpID,Date,StartTime,StopTime

ScheduleID is an autonumber and EmpID is the autonumber from tblEmployees.
The problem is that first and last are not part of the destination table but
are needed to determine the EmpID. I a at a loss for where to begin here...
Any help would be greatly appritiated...

Thanks,
Ernst.
 
D

Douglas J. Steele

I don't think you have any option but to import them into a temporary table,
and then join that temporary table to tblEmployees to determine the
appropriate EmpID value.

That having been said, it may not work properly. Assuming First and Last are
the first and last name of the employee, that may not be sufficient unique
to determine the employee id: I've worked in plenty of places where
employees had the same first and last names.
 
J

Jeff Boyce

I'll chime in ... one of your fields appears to be named "Date". This is a
reserved word in Access, so what Access decides you mean and what you think
you mean may not be the same.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top