Search code examples
sqlms-access

Military Time Form Validation msAccess Form View


I'm having a difficult time doing military time or short time in the form view. I caught an error where the user put in 15:83 which shouldn't be allowed because the minutes are over 59, as well hours being over 23. However, I'm not sure how to create a form validation for something like that and I can't seem to find any documentation for it online surrounding this type of formatting.


Solution

  • in the validation rule property of the text box control on the form enter this expression

    =Right([Text6],2)<60 Or Left([Text6],2)<24

    i have assumed name of control is Text6