Results 1 to 6 of 6
  1. #1
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383

    Field to display hours and minutes

    I am trying to make a field in my table for hours and minutes, can this be done?
    Here is the info. Field Name is tme and it is date/time format with a format of hh\,nn
    So, I would like to be able to enter the hours and minutes in this field, do I have to make two fields for this? If so what is the format I would choose for each field? To be clear, I want to be able to enter the hours and minutes I want in this field.

  2. #2
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Just to clarify are you

    Trying to enter a 'Time' as in 1:30pm in the afternoon

    or are you

    Trying to enter 2 hours and 45 minutes, as in "It took 2 hours and 45 minutes to complete the assigned task?

    Linq ;0)>

  3. #3
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    Yes, 2 hours and 45 minutes is what I am after.

  4. #4
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    First off, this/these Field(s) should not be Date/Time Field(s). A Date/Time Field is used to pinpoint a specific point in time, such as January 19, 2013 @ 1:30pm.

    Fields to represent hours and minutes, as in 'the number of hour(s) and minute(s) it takes to accomplish a task, are just that, Numbers, and the Field should be defined as such, at the Table-level.

    You can either simply

    • Have two Controls/Fields, for entering the hours and minutes
    • Have a Control for entering the total number of minutes, then use code to populate an Hour Field and a Minute Field.

    Code would be something like this:
    Code:
    Private Sub txtEnterTotalMinutes_AfterUpdate()
     Me.txtHours = txtEnterTotalMinutes \ 60
     Me.txtMinutes = txtEnterTotalMinutes Mod 60
    End Sub

    Linq ;0)>
    Last edited by Missinglinq; 01-19-2013 at 09:23 PM.

  5. #5
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    Thank you, I will adjust my table fields and give this a try.

  6. #6
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    Okay, now I need the end result. I added the fields txtHours and txtMinutes to my table and set them to a number. Now on my form I have 8 hours (txtHours) and 45 minutes (txtMinutes) for both the fields. I have an unbound field that I need to total this out in. Add the the total hours and minutes as a final result. Unbound field is named txtresult

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

Similar Threads

  1. formating hours and minutes to 0.00 format
    By live2ride in forum Access
    Replies: 17
    Last Post: 09-18-2012, 07:52 PM
  2. Replies: 4
    Last Post: 08-06-2012, 10:25 AM
  3. Converting Minutes Into Hours
    By KellyM in forum Reports
    Replies: 8
    Last Post: 04-23-2012, 12:49 PM
  4. Overall Total of Hours & Minutes in Report
    By StevenCV in forum Reports
    Replies: 1
    Last Post: 02-27-2012, 10:48 AM
  5. How to calculate duration in hours & minutes
    By joypanattil in forum Access
    Replies: 0
    Last Post: 11-25-2009, 04:49 AM

Tags for this Thread

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