Results 1 to 3 of 3
  1. #1
    flmoeron is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Aug 2015
    Posts
    1

    Need macro to update a combobox name field that is resides in another table after an import

    I'm helping out a client move data between two systems. A .csv file is being imported into a table "LABOR" that includes hours worked and an employee id (text - labeled EMP #). Another table named "SERVICE TECHS" contains the employee name (combo box - labeled NAME) as well as the employee id (text - labeled EMP #). What I'm looking for is a macro I can run after the data has been imported into the table "LABOR" that looks at the employee ID in the "LABOR" table, cross references it to the "SERVICE TECHS" table and updates the employee name (combo box - labeled NAME) in the "LABOR" table accordingly.



    So if I import a record into the "LABOR" table that has employee ID of 1234 and according the to the "SERVICE TECH" table, employee ID 1234 is John Smith, after importing the 8 hours that employee ID 1234 worked, I want to run a macro that updates the employee name (combo box - labeled NAME) record in table "LABOR" to reflect the value of John Smith.

    This is probably Access 101, but I'm not overly proficient in Access...I can use VLOOKUP in Excel like no tomorrow, but I'm not certain how to accomplish this in Access.

    Thanks in advance for assistance!

    B(c)

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Why is employee name being saved in LABOR table? This is duplication of data. Only the EmployeeID should be in LABOR table.

    Retrieve the employee name in query that joins tables on EmployeeID fields. This means EmployeeID in SERVICE TECHS table should be defined as primary key.

    That is Relational Database Principles 101.

    Advise no spaces or special characters/punctuation (underscore is exception) in naming convention. Also, no reserved words as names and title case is better than all UPPER CASE.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    nick404's Avatar
    nick404 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2015
    Location
    Wisconsin
    Posts
    352
    A list of reserved words in Access: https://support.office.com/en-in/art...7-da237c63eabe

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

Similar Threads

  1. trying to use after update macro to change field
    By justlearning123 in forum Programming
    Replies: 3
    Last Post: 07-03-2015, 12:32 AM
  2. Replies: 17
    Last Post: 10-27-2014, 04:15 AM
  3. Replies: 1
    Last Post: 08-14-2013, 04:09 PM
  4. Replies: 7
    Last Post: 04-18-2012, 11:38 AM
  5. Replies: 0
    Last Post: 04-17-2008, 09:24 AM

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