Results 1 to 5 of 5
  1. #1
    marksnwv1957 is offline Novice
    Windows XP Access 2002
    Join Date
    Aug 2012
    Posts
    2

    Changing names to ID numbers

    I recieve Excel worksheets with information and then import this information into a table I have in access. I verify the data and as a last step I append the data to a table called AllReportData2012 which is used to pull information for my reports. Part of the Excel information that is imported to a new table includes the employee's name with work details in each row.



    In my access report I do not use the employees name, I use their employee ID number. I have a table in my acess database that contains 2 columns. The employees Name and their associated Employee ID number.

    After I import the Excel information to Access how do I set up a macro or programming that will look at the name in each row and change it to the correct Employee ID. I could have anywhere from 20 rows of recods to 600 rows of records.

    Thanks in advance for any help.

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    You don't really need to change anything. Just create a query between the two tables in Access, linking on the Employee name and returning the Employee ID with all the other fields you want.

    See here if you need help in doing that: http://www.ehow.com/how_12392_create...ft-access.html

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,849
    Use a Query along these lines

    Code:
    Select FromExcel.*, YourAccessTable.EmployeeId
    FROM FromExcel INNER JOIN YourAccessTable ON
    FromExcel.EmployeeName = YourAccessTable.EmployeeName

    Where FromExcel is the name of the Table populated with the Excel data and
    YourAccessTable is the name of your table (I have a table in my acess database that contains 2 columns. The employees Name and their associated Employee ID number.)

    This query would be used for your Report

    OOPs: I see JoeM is quicker and not as long winded as I am.

  4. #4
    marksnwv1957 is offline Novice
    Windows XP Access 2002
    Join Date
    Aug 2012
    Posts
    2
    Thank you. Your recommendation works perfectly

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,849

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Names not Numbers
    By leeli67 in forum Database Design
    Replies: 12
    Last Post: 02-27-2012, 11:42 AM
  2. Reports and changing the names
    By brobb56 in forum Access
    Replies: 9
    Last Post: 09-21-2011, 03:57 PM
  3. Changing table names from lowercase to uppercase
    By supernix in forum Database Design
    Replies: 1
    Last Post: 09-03-2010, 10:08 PM
  4. Changing names and labels
    By Geewaagh in forum Reports
    Replies: 29
    Last Post: 04-20-2010, 10:26 PM
  5. Changing field names in queries
    By scottsoo9 in forum Queries
    Replies: 1
    Last Post: 12-01-2009, 05:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums