Data Entry in Access ( Monthly Flying Hours)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Johirul Islam
    New Member
    • Oct 2011
    • 1

    Data Entry in Access ( Monthly Flying Hours)

    How can I made a data entry in MS Access table over 24:00 hrs?
    Suppose When i entry in the table 112:34 in the "Flying Hours" field access do not Accept it and give an error message. Please give me solution.
  • nico5038
    Recognized Expert Specialist
    • Nov 2006
    • 3080

    #2
    You might check the Date/Time functions at:


    Nic;o)

    Comment

    • patjones
      Recognized Expert Contributor
      • Jun 2007
      • 931

      #3
      I have had this problem in the past also. The trouble with Date/Time types is that a value like 112:34 is not really a date or a time. It's more like elapsed time.

      What I have done to overcome this problem is define the column as Text, assign the Format as hhh:mm (Access will change it to hhh:nn), and give it an input mask of ###:00;0;*. What this means is that the first three digits are optional, but the last two digits (minutes) are required.

      Pat

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32663

        #4
        This is something many would say is an unfortunate omission from the design of Office applications - The ability to handle date/time differentials.

        There are three problems associated with this as things stand :
        1. Entry of a value in such a way as allows it to be interpreted correctly.
        2. Storage of the value.
        3. Display of values such that they make sense.


        My recommendation would actually be to store the value as a DateTime. This doesn't help much with displaying or entry of data, but does allow sensible arithmetic to be performed on it which is generally core to such a requirement. With that in place we still have very real issues with entry and display.

        Entry can be handled by using an unbound TextBox with code behind it that converts the entered text into a valid DateTime value. As long as you don't try to view the value in a standard way that part should work fine.

        The form could use a separate routine for displaying the value into (probably) the same TextBox (for both display and potential amendment).

        It's a big overhead to provide something that probably should come with the software, but I see no good alternative.

        Comment

        • patjones
          Recognized Expert Contributor
          • Jun 2007
          • 931

          #5
          I should have pointed out that with my method one needs to make special accommodations for doing math with the values.

          Comment

          • nico5038
            Recognized Expert Specialist
            • Nov 2006
            • 3080

            #6
            Basically you should use a date/time field starting with 0 and when the hrs > 24 Access will add a day.
            Next when showing the result you can use special fields (like zepphead80 proposed) and display the hours by multiplying the Int value by 24 and adding the Hrs.

            The link I posted will show all type of manipulations with dates, including this "problem".

            Nic;o)

            Comment

            Working...