Results 1 to 5 of 5
  1. #1
    Tvanduzee is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jul 2012
    Posts
    39

    Automatic year month day with user entered time

    Hello
    Im setting up schedule times (8 AM till 9 PM) in increments of 30 minutes.
    In my table, I have start time and end time. As some of you may already know, the date reverts to 1899 for the year.


    Because each year the Dates for my event will change, I cannot fill the table with Year, Month, Day.
    On my form, I have cbo's to select the start and end time for shifts (values come from the tblTimes table). When I attempt to calculate the duration, it always ends up with about 150 days (depending on the times I select) (Im assuming it is days) -- (End time - Start time) * 24. I noticed it was calculating in the year 1899. So, I need, somehow to change the default year month and day at the form level to the dates of the event, so when the user selects the time, it will be for 1 of 3 days (event is always on Fri, sat, sun). I say at the form level so that this year I can still run off a report on last years event.

    Ex:
    This year:
    Friday, September 11 was the start of the event, and Sunday, September 13 was the last day.
    Next year, I do not know what the date will be, but the end user will simply need to schedule people based on the day (Fri, sat or sun) and not have to enter the year, Month (which should be put in automatically based on an input field or something.

    Im sorry if I have not articulated this very well, it seems more difficult to explain than what I thought it would be.

    Thank You
    Terry

  2. #2
    Perceptus's Avatar
    Perceptus is offline Expert
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Location
    Knoxville, Tennessee
    Posts
    659
    Many times I solve my own issues by just typing out what the issue is on the these forums. Getting all my thoughts out and organizing them does wonders.

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Need better understanding of data structure. If you want to provide db for analysis, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    Tvanduzee is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jul 2012
    Posts
    39
    Quote Originally Posted by June7 View Post
    Need better understanding of data structure. If you want to provide db for analysis, follow instructions at bottom of my post.
    I have no data in the database except the times in the tblTimes table.
    I have started a form for TeamLeads which each person in that table for the current year will be scheduled (start and end times). I need to calculate the duration so that I can explore making a gaant chart for it.. so we can see visually where we might be short handed in any particular area (there are 11 areas).

    Thank You
    Terry
    Attached Files Attached Files

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    What is this database for? I am confused by the data structure. Some dummy records would be helpful.

    Multiple similar fields (Area, Area2, Area3) is not a normalized data structure.

    Why is tblAreas linked to both tblTeamLeads and tblH4MYear? This can be problematic - review http://www.codeproject.com/Articles/...atabase-Design

    Tables should be linked on primary key/foreign key fields. You have autonumber ID designated as primary key in several tables yet you link on other fields.

    All of the relationships are 1-to-1.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Calculate Time in Service (year, month, day)
    By Randell in forum Programming
    Replies: 2
    Last Post: 07-30-2015, 05:49 PM
  2. Replies: 4
    Last Post: 07-13-2015, 02:06 PM
  3. Replies: 4
    Last Post: 05-26-2013, 03:28 PM
  4. Automatic generation of tax year
    By Redhillgeneral in forum Database Design
    Replies: 6
    Last Post: 11-01-2012, 11:30 AM
  5. Automatic checkbox based on value entered in form
    By w00tage19 in forum Database Design
    Replies: 2
    Last Post: 07-12-2010, 04:20 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