Update new training start and due dates (1 Viewer)

Slakker99

New member
Local time
Today, 16:48
Joined
Oct 20, 2020
Messages
2
Hello,
I need some assistance on a DB I've created. I want to create a button that updates start and due dates per employee training, problem is I have created a button that updates all the training start and due dates to the date input in the form, and it updates the whole field instead of the specific employee and training dates. How do I make an update button for a specific employees' training dates?
 

CJ_London

Super Moderator
Staff member
Local time
Today, 23:48
Joined
Feb 19, 2013
Messages
16,600
use a criteria - something like

WHERE EmpPk =forms!myForm!EmpPk

but why not just use a bound form?
 

hipromark

New member
Local time
Today, 17:48
Joined
Oct 20, 2020
Messages
3
You need to create an update query using the date selected as criteria, and selecting just the fields you need to update. That way only the records that match the criteria will be updated
 

Slakker99

New member
Local time
Today, 16:48
Joined
Oct 20, 2020
Messages
2
use a criteria - something like

WHERE EmpPk =forms!myForm!EmpPk

but why not just use a bound form?
That's an idea, I'm selecting data from two different tables ( employee and training select tables) that are adding/updating the training DB table. The form has drop down menus giving the selections from both tables and then date picker boxes. Would I use a bounded form for that or the Where criteria? How would I write out the Where criteria?
 

CJ_London

Super Moderator
Staff member
Local time
Today, 23:48
Joined
Feb 19, 2013
Messages
16,600
better to use a bound form, no code required.

without knowing the full background to your requirement suggest you need perhaps 3 tables

tblEmployees
empPK
empName

tblTrainingCourses
CoursePK
CourseName
CourseDate

tblEmployeeCourses

empCoursePK
empFK - links to empPK
CourseFK- links to coursePK

so your main form might be based on tblemployees with a continuous subform based on tblEmployeeCourses. This subform only needs to display a combobox based on tblTrainincCourses

Alternatively your main form might be based on tblTrainingCourses with a continuous subform based on tblEmployeeCourses. For this way the subform only needs to display a combobox based on tblEmployees
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 18:48
Joined
Feb 19, 2002
Messages
43,203
It is importing to understand the difference between single actions and bulk actions.

If you are adding classes one at a time to an employee's record, you would use a bound form.

If you wanted to add one class to every employee in a department or who had a particular job title, you would use an append query.
 

Users who are viewing this thread

Top Bottom