• ** There has been a recent site upgrade. Please clear your browser cache to avoid issues. **
  • New forum feature - post voting and best solution

    Check out this thread for the details: https://www.access-programmers.co.uk/forums/threads/new-forum-feature-post-voting-and-best-answer.314134/

    This new feature looks great to me! :)

  • We now have 3 forum themes

    Go for the default (light) theme, Shades of Grey or Shades of Blue. I just added the Blue one.

    The thread about it is here: https://www.access-programmers.co.uk/forums/threads/new-forum-theme-shades-of-blue.314136/

Solved Need some help trying to figure out automatic data entry (1 Viewer)

dawsonrhodes

Member
Local time
Yesterday, 23:27
Joined
Mar 8, 2020
Messages
34
Hello all,

I have been building an employee database, it has gone amazingly, just ran into something I wouldn't know how to sort out.

Basically, when we have a new training requirement come out we need to track completion. The way I currently do that is adding it in through the "Add New Training" form that I have attached as a png. But that then requires me to go into each person "profile" and create a new training log for each person and then mark it as completed.

What I am trying to do now is make it so that when I add a new training module I can select a box that will automatically make an entry in the query for each "person/id" that I can later go and just edit rather than having to manually add it with drop downs.

Thanks all!
 

Attachments

  • Add New Training.PNG
    Add New Training.PNG
    23.8 KB · Views: 17
  • Training Viewer.PNG
    Training Viewer.PNG
    26.7 KB · Views: 20

Gasman

Enthusiastic Amateur
Local time
Today, 04:27
Joined
Sep 21, 2011
Messages
6,764
Have a form to select a certain course and records for each employee with a checkbox for each employee and tick those that need to take the course. Then process that recordset and create the relevant records.?
 

arnelgp

error reading drive A:
Local time
Today, 11:27
Joined
May 7, 2009
Messages
10,521
add code to the Form's Before Update event to add the training to Each employee:

private sub form_beforeupdate(cancel as integer)
If Me.NewRecord Then
currentdb.execute "insert into emp_training_table (course_id, emp_id) " & _
"select " & Me.course_id & ", employee.emp_id from employee_table;"
end if
end sub
 

dawsonrhodes

Member
Local time
Yesterday, 23:27
Joined
Mar 8, 2020
Messages
34
add code to the Form's Before Update event to add the training to Each employee:

private sub form_beforeupdate(cancel as integer)
If Me.NewRecord Then
currentdb.execute "insert into emp_training_table (course_id, emp_id) " & _
"select " & Me.course_id & ", employee.emp_id from employee_table;"
end if
end sub


Not sure how to write that for mine. Here is the layout of my database

tblEmployees (master for all employee data)
  • ID (autonumber)
  • EmployeeID (the number I designate them)
  • Name and so on
tblEmployeeTraining
  • TrainingID
  • Employee (so their auto ID in the tblEmployees table)
  • NameofTraining
  • Category
  • and so on
 

Users who are viewing this thread

Top Bottom