Results 1 to 3 of 3
  1. #1
    lightkeepr is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Posts
    10

    stumped

    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?

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,849
    You are telling us HOW you are doing something. Can you tell us in plain English WHAT you are trying to do and give us some rationale as to WHY you are doing so?
    Conundrum ??(A clear statement of requirements?)
    Have you researched Normalization?

  3. #3
    lightkeepr is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Posts
    10
    what: I want to take a 2 week date range from both tables and if the date and school name are the same, copy the values from the school table to the payroll table.
    why: because when the two are merged as explained above, an additional value for the hours worked or the shift weight column will change to zero. I want to be able to see on a report that the zero value was caused by school being out.

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

Similar Threads

  1. I'm COMPLETLY STUMPED
    By allstar45 in forum Programming
    Replies: 15
    Last Post: 03-06-2012, 02:14 PM
  2. Stumped on date
    By tmcrouse in forum Queries
    Replies: 2
    Last Post: 12-29-2011, 02:45 PM
  3. PLEASE HELP...deadline at work and stumped!
    By dukenukem in forum Forms
    Replies: 4
    Last Post: 11-25-2011, 01:06 PM
  4. Really stumped newbie here
    By alwittlich in forum Access
    Replies: 5
    Last Post: 05-18-2011, 11:55 AM
  5. Stumped on an INSERT
    By Elisa in forum Programming
    Replies: 1
    Last Post: 12-26-2009, 10:49 AM

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