Results 1 to 4 of 4
  1. #1
    DevMan1 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    2

    How to select data fields from tableA to auto populate fields in tableB

    I have some questions regarding on how to set things up to select data fields from TableA to auto populate some data fields in TableB. Thank you in advance for any help that you can provide on this.

    TableA has the following data fields (for employee availability information)
    -EmpAvID
    -EmpAvDate
    -EmpName
    -EmpHrsTotal (total hours available for the date)
    -EmpHrsWrk (hours worked)
    -EmpHrsAvailable (hours available = HrsTotal-HrsWrk)
    -TaskName

    Data will be created in TableA first to contain records for various dates and related info such as employ name, total hours, hoursWrked, hoursAvailable. TaskName will be populated later.

    TableB has the following data fields:
    -TaskID
    -TaskName
    -TaskDate
    -TaskHours
    -EmpName
    -EmpHrsTotal
    -EmpHrsAvailable

    Requirements:
    - After a new record is created for a new task with TaskName, TaskDate, and TaskHours (in TableB), the user need to be able to get a list of available EmpName/EmpAvDate/EmpHrsTotal/EmpHrsAvailable available (from TableA) for the specific task and date.
    The selection criteria are: EmpAvDate=TaskDate, EmpHrsAvailable>=TaskHours.

    - After the user select an EmpName/EmpAvDate/EmpHrsTotal/EmpHrsAvailable from the select list, the data fields in the TableB and also TableA are set as follow:

    In TableB,
    EmpName = EmpName from selection list
    EmpHrsTotal = EmpHrsTotal from selection list
    EmpHrsAvailable = EmpHrsAvailable from selection list

    In TableA,


    TaskName = Taskname from TableB

    How can these be implemented? Using a como box (for EmpName) in a FORM for TableB?
    How can the TaskName in TableA be set equal to TaskName in TableB?

    I hope that the information provided is clear enough.
    Any help are greatly appreciated!

  2. #2
    burrina's Avatar
    burrina is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    This sounds like a typical Mainform/Subform design. If the tables are linked correctly, then you should be able to populate your data.
    Example: Main form contains Employee Info.
    Subform contains the Details.i.e. Hours,etc...

    HTH

  3. #3
    DevMan1 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    2
    Burrina,

    I am a new Access 2010 user. Could you please provide details on how to implement the Mainform/Subform that you suggested?

    Thank you for you help on this.

  4. #4
    burrina's Avatar
    burrina is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    You have TableA and TableB. So you have a Main form that uses TableA and then the Subform uses TableB and the two forms are Linked by Master/Child with the Primary Key.
    If this does not make sense to you. Please do some research on database design and read some books on Access.
    Here is an excellent link for examples: http://www.databaseanswers.org/data_models/
    HTH

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

Similar Threads

  1. How do I auto populate several fields at once
    By learmanj in forum Programming
    Replies: 4
    Last Post: 07-20-2013, 11:41 AM
  2. Auto Populate Fields & New Entry
    By Jarede in forum Forms
    Replies: 6
    Last Post: 02-12-2013, 05:23 PM
  3. Replies: 7
    Last Post: 12-02-2012, 08:32 PM
  4. Auto Populate two fields
    By funkygoorilla in forum Access
    Replies: 7
    Last Post: 08-31-2011, 09:06 PM
  5. Match Records between TableA and TableB
    By friskydingo in forum Queries
    Replies: 0
    Last Post: 12-03-2008, 09:17 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