Results 1 to 3 of 3
  1. #1
    kstrecker1701 is offline Novice
    Windows 7 32bit Access 2013 32bit
    Join Date
    Jul 2018
    Posts
    12

    Related fields populating in Datasheet view

    I've designed a simple form for entering new employee information. The main table it's based on is EmployeeInfoT. The primary key is EmployeeID, and the other fields store basic info like FirstName, LastName, HireDate, etc.

    I have another table, DepartmentInfoT, that stores Department and Manager info. Each Department has only one Manager.

    I've joined the DepartmentInfoT table's primary key (DeptID) to the Department field in the EmployeeInfoT table. Each Department can have several Employees.

    When I input a new employee's info in my form, I can choose the Department from a dropdown box, and then the corresponding Manager's name automatically appears in a text box field below it. This is perfect - exactly what I want to happen.



    However, if I input the info directly into the EmployeeInfoT datasheet, I can't get that Manager field to populate correctly. It gives me another dropdown box with all the Managers' names to choose from. So it's possible I could choose the wrong Manager for the given Department.

    Is there a way for the correct Manager's name to automatically appear in the Datasheet view, just like it does in the form? What other info do you need in order to assess this situation?

    Thanks!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    the DEPT field should be in tEmployeeInfo
    to get the manager, use a query to join tEmployeeInfo.Dept to tDeptInfo.Dept and add tDeptInfo.Manager field.

  3. #3
    kstrecker1701 is offline Novice
    Windows 7 32bit Access 2013 32bit
    Join Date
    Jul 2018
    Posts
    12
    Quote Originally Posted by ranman256 View Post
    add tDeptInfo.Manager field.
    To what? The query or the EmployeeInfoT table?

    If I create the query joining those two tables (EmployeeDeptMgrQ), then if I try to create a Manager field in my EmployeeInfoT table that draws data from the DepartmentInfoT_Manager field in the query, I get the error:

    "No valid fields can be found in 'EmployeeDeptMgrQ'. You may have selected a query that uses the table you're adding the lookup column to. Please select a new source."

    I must be missing some basic piece of info about how tables and queries work.

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

Similar Threads

  1. User-Selectable Fields in Datasheet View
    By Chim20 in forum Forms
    Replies: 9
    Last Post: 02-16-2016, 03:12 PM
  2. Replies: 3
    Last Post: 08-18-2013, 09:14 PM
  3. Expand Button in Datasheet View Doesn't show related table
    By CementCarver in forum Database Design
    Replies: 5
    Last Post: 07-17-2013, 11:48 AM
  4. Replies: 2
    Last Post: 09-21-2011, 07:23 AM
  5. datasheet view adding fields drop-down box
    By techexpressinc in forum Access
    Replies: 2
    Last Post: 09-09-2009, 05:35 AM

Tags for this Thread

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