Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    perryc is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2019
    Posts
    122

    Table Template

    All,
    I have a table with a template schedule for an orientation of new hires. The tables contain fields like Date, Event, NewEmpID...What is the best way to duplicate the template and update dates and NewEmpID?

    (template)
    Date: 01/03/2022 Event: Meet with John NewEmpID: 1
    Date: 01/04/2022 Event: Meet with Mary NewEmpID: 1
    Date: 01/05/2022 Event: Training1 NewEmpID: 1

    I want to duplicate this template and change the date and NewEmpID for all the events...
    Date: 04/11/2022 Event: Meet with John NewEmpID: 2
    Date: 04/12/2022 Event: Meet with Mary NewEmpID: 2


    Date: 04/13/2022 Event: Training1 NewEmpID: 2

    I know I can manually change the dates and NewEmpID, but, is table has 50rows, may take a while and can make mistakes.

    Ty in advance.

    Sincerely,
    Perry

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933
    You need a primary key which could be negative to indicate It is a template. Or you can have a separate’istemplate’ field

  3. #3
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Looks to me like this is about multiple tables for the same things, the difference being who know what - perhaps month or year. That would be the wrong approach. Might also be that meetings should be in one table and training in another lest it become difficult to separate the 2 things.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    Join Date
    Apr 2017
    Posts
    1,792
    From your explanation, it's quite vague what you are trying to do, but I'm trying to estimate what this must be!

    You have to keep some schedule table, and there are some recurring events you need to apply to this schedule table on regular basis.

    You must have the schedule table, like:
    tblSchedule: EventID, EventDate, EventType, EventDescription, ... (EventID is an autonumeric integer field, EventType has values indicating Meeting, Trainng, etc.)

    You must have the employees table, like:
    tblEmployees: EmployeeID, EmploymentDate, Forename, Lastname, ... (EmployeeID is an autonumeric integer, in case you need to enter unique identifier manually too, add an additional field and create an unique index on it)

    To automate new events, you need a table where you can define any regular events - like:
    tblRegularEvents: RegularEventID, DayNo, MonthNo, Period, EventType, ..., LastRunDate (RegularEventID is an autonumeric integer. Period has values indicating the event is added daily, weekly, monthly, or yearly. DayNo and MonthNo are filled or left empty depending on Period)

    And as last step, you create a procedure, which:
    1. Checks tblRegularEvents for events which were scheduled to be added to tblShedule after LastRunDate;
    2. Checks tblShedule, to be sure any events returned in step1 weren't added earlier;
    3. For events of types handling new employees, gets list of new employees with EmploymentDate > LastRunDate
    4. For every EventType from step1, runs another procedure,which adds events of according type from list of events gotten from step1 and step2 to tblEvents
    5. As last step, overwrite LastRunDate with current date (not datetime!)

    You can run this procedure manually (from button on form), or you can run it from OnOpen event of your main form.

  5. #5
    perryc is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2019
    Posts
    122
    Thank you all so much for your insight. I will think about what you have suggested. I will likely ask more questions later.

  6. #6
    perryc is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2019
    Posts
    122
    Ajak, That's a good idea.

  7. #7
    perryc is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2019
    Posts
    122
    Mircon, I hear you. That's true. You are much more organized than me. I will give it some thought.

  8. #8
    perryc is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2019
    Posts
    122
    Arvilaanemets, ty for your detail thoughts. Let me try to explain a little more of what I am trying to accomplish. So, in excel, there is these formula that when one value is changed, the subsequent value can be changed. e.g.
    Cell1 = Date1, Cell2 = Date1+1, Cell3 = Cell2+1... only 1 date is changed (Cell1) and subsequent cells are updated automatically. Can this be done in Access? I have no idea because it is a table now. How do I define Tablevalues with a formula?

  9. #9
    Join Date
    Apr 2017
    Posts
    1,792
    Quote Originally Posted by perryc View Post
    How do I define Tablevalues with a formula?
    Don't do this with formula in table! Instead do it using queries or procedures, which are run by form/control events

    Generally, a table is something you work with when you create it. After that, less you (or any user) dabble with it directly, the better!

  10. #10
    perryc is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2019
    Posts
    122
    Well, the problem is, the values (dates, events...) need to be repeated from the template whenever the next new hires start and we will repeat the whole thing, except the dates will change. I do not know how to approach this best besides manually copy and paste the entire schedule template and then change the dates accordingly. Ty anyway.

  11. #11
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933
    is there a principle that the second event follows a set number of days or weeks after the first and the third after the second, etc? if so, subsequent dates can be determined from the initial date. Your initial example shows 1 day difference, but that may be because it is not a real world example.

    Also it may be that the 'description' should just be 'meet with' or 'training' and you then specify with who or what type of training.

  12. #12
    perryc is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2019
    Posts
    122
    The date are mostly weekdays (M-F). The first day is known. The subsequent dates are be populated but skip the weekends (no one will train on the weekends). However, I need to be able to update these dates or descriptions at anytime.

  13. #13
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933
    easy enough to skip weekends - what about bank holidays as well?

  14. #14
    perryc is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2019
    Posts
    122
    Well, we only observe 6 major holidays. Memorial, Jul 4, Labor Day, Thanksgiving, Christmas and NY day

  15. #15
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933
    so you will need a table to store those dates for each year (I assume if Christmas is a saturday or sunday, the bank holiday is the monday). If the selected day is a bank holiday, skip another day.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Excel Template File to Add/Update Access Backend Table
    By stildawn in forum Import/Export Data
    Replies: 3
    Last Post: 05-05-2020, 09:49 AM
  2. Replies: 9
    Last Post: 12-21-2017, 01:53 PM
  3. Replies: 3
    Last Post: 07-31-2014, 01:08 AM
  4. Replies: 8
    Last Post: 01-27-2014, 12:41 PM
  5. Replies: 1
    Last Post: 12-13-2013, 07:11 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