Validation Rule for DATE

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • knittingdoc
    New Member
    • Oct 2006
    • 1

    Validation Rule for DATE

    How do I create a validation rule for a date which is all numbers?
    Example: 12-02-06 How do I make a rule to make sure the month field is >0 and is equal to or less than 12?

    Likewise with the day? How do i make sure the day is greater than 0 but less than 31?

    thanks....David
  • pks00
    Recognized Expert Contributor
    • Oct 2006
    • 280

    #2
    Originally posted by knittingdoc
    How do I create a validation rule for a date which is all numbers?
    Example: 12-02-06 How do I make a rule to make sure the month field is >0 and is equal to or less than 12?

    Likewise with the day? How do i make sure the day is greater than 0 but less than 31?

    thanks....David

    What do u mean by all numbers? do u mean a syntax like DDMMYYYY or MMDDYYYY?

    If this is a bounded form and the textbox is based on a date field, u can set the format property to be this date mask and let access do the validation for u

    failing that u could use the BeforeUpdate in code and validate it that way

    But since I dont know what date mask u are using, its difficult to know what kind of validation to put

    Comment

    • MMcCarthy
      Recognized Expert MVP
      • Aug 2006
      • 14387

      #3
      Originally posted by knittingdoc
      How do I create a validation rule for a date which is all numbers?
      Example: 12-02-06 How do I make a rule to make sure the month field is >0 and is equal to or less than 12?

      Likewise with the day? How do i make sure the day is greater than 0 but less than 31?

      thanks....David
      From your question it sounds as if you haven't set your Date Field to a date format as this would automatically validate the question your asking.

      What format are you using and why?

      Comment

      Working...