Results 1 to 4 of 4
  1. #1
    selvakumar.arc is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    49

    Validation Rule for Date Format

    How will I enforce date validation in MS Access Form?

    I have data sheet form in my application and one of the column named "Effective Date" need to enforce date validation. The column type is varchar and this column should accept any date range (min range to max range).



    Regards,
    Selvakumar R

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Why is a date field defined as varchar?
    Can you give an example of an inputted Date?
    You are talking about the Validation rule on the table field right?
    Why not make it a Date/Time data type with General Date format and make it a required field?

  3. #3
    selvakumar.arc is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    49
    Why it is defined as Varchar - After deployment to production clients wants a date column without altering/deployment of the application, basically they dont want to go for database change. So we hijacked existing column and used it. We dont have any other column with date time format so we used varchar column for storing "Effective Date".
    Date format - "MM/dd/yyyy" like "03/04/2014"
    Validation on table field - Yes this is table field, before inserting data into table need to validate the data. I want to implement it through Validation Rule in control property.
    Why not make it a Date/Time data type - It is in production and client dont want to make any database changes. They want it to handle through front end.

    Please help me to solve this issue.

  4. #4
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    You could do a CDate (yourVarcharField) to change the text to Date.
    You can then check for a valid date using

    IsDate(CDate (yourVarcharField)) which will return a boolean True for Date, False if not
    You can do further checks based on your requirement
    eg xx or more days since Start etc.

    Good luck.

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

Similar Threads

  1. Cannot set validation rule on Date/Time type
    By intheflesh77 in forum Access
    Replies: 2
    Last Post: 10-12-2013, 08:57 AM
  2. Replies: 1
    Last Post: 05-29-2013, 04:01 PM
  3. Validation Rule
    By robomose in forum Access
    Replies: 1
    Last Post: 09-09-2009, 05:59 AM
  4. Validation Rule: Date
    By krymer in forum Access
    Replies: 0
    Last Post: 08-27-2008, 03:30 PM
  5. Validation Rule
    By mistaken_myst in forum Database Design
    Replies: 2
    Last Post: 10-29-2007, 02:08 PM

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