My current conundrum is that I am trying to take data in one table and merge it with another table by using dates and a field value to limit the merge if that makes sense.
here is the table layouts:
[tbl_payroll_status]
-ID (pk)
-date_worked
-school_name
-cw_location
-shift_time
-shift_weight
-default_guard
-working_guard
-cw_time
-shift_id
-default_log
-sub_log
-sub_code
-school_status
-school_reason
[tbl_school_schedule]
-ID (pk)
-date_worked
-school_name
-school_status
-school_reason
I have a VBA script that runs on command to put values for the tbl_payroll_shifts in automatically for all fields except the school_status and school_reason. Once the script is done creating all the shifts for the specified date range, I want it to now look at the [tbl_school_schedule] table for those same date ranges (they are txt_payroll_start_date and payroll_end_date) and if a record in that table matches the date_worked field in tbl_school_schedule and tbl_payroll_shifts and the school_name field in both tables matches, copy the school_status and school_reason field from tbl_school_schedule to tbl_payroll_shifts.
Any suggestions on how to achieve this using VBA code?