([StartDate] <= [EndDate])

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hazardinc
    New Member
    • Jul 2012
    • 1

    ([StartDate] <= [EndDate])

    I am trying to create a field validation that will pop up a warning that the start date must be before the end date however it keeps failing I have tried multiple variants yet they still do not work.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Not working isn't a very helpful statement. What about it isn't working? Are you getting errors? What is the text of the error? Is the validation occurring but giving incorrect results? What are the incorrect results you're getting?

    Comment

    • Mihail
      Contributor
      • Apr 2011
      • 759

      #3
      As far as I know this is not possible for a table.
      You must design a form then use the before update event (for that form) to check the dates.

      Cheers !

      Comment

      • zmbd
        Recognized Expert Moderator Expert
        • Mar 2012
        • 5501

        #4
        Not at field level... at table level

        AFAIK: You can not do this at the data-entry level as the record hasn't been saved yet; thus, the field data doesn't seem to exsist as far as MSA is concerned...

        My workaround for those occations I really want this to happen at the table level is to do this in the table level properties.

        How I do this in 2010 is to design the fields, then click on the tab of the table, click on the properties button in the ribbon table-tools-design:
        [IMGnothumb]http://bytes.com/attachments/attachment/6479d1342443962/tableproperties .jpg[/IMGnothumb]
        Notice I didn't use a very informative message... What I think happens now is that the record is committed to the table... and the fields are available for review. I really don't know; however, it works! :)

        One thing to note... if you are using an autonumber, when the validation fails, if the user cancels the save, the autonumber will increment and the record coursor stays on the last field selected prior to attempting to save the record so if you have mulitple validations going at this level it makes a validation text message harder to write!

        -z


        -z
        Attached Files

        Comment

        Working...