Results 1 to 6 of 6
  1. #1
    cmwpcol is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2012
    Posts
    4

    Limiting entry in date field to three dates

    I have limited knowledge with Access especially with creating expressions and macros.

    I am looking for help on setting up a validation rule in a date field that will limit the entry to three specific dates.

    The field is: [Expiration Date]. The Data Type is: Date/Time The format is: Short Date (m/d/yyyy)

    I want to limit the entry in this field to: 1/1, 2/1, or 4/1 with the ability to enter the applicable year.

    Any assistance with this would be greatly appreciated.


    Thank you,


    cmwpcol

  2. #2
    Jrbeene86 is offline Novice
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    12
    Hey


    I don't know any short solutions, but...


    you could create two combo boxes and limit the row source to a value list and put "1/1"; "2/1"; etc
    The second combobox would contain "11";"12";"13"; etc.

    then put an After update event on the second box to requery a third. This third box would be the control source and set up as concatenated field with the default value being something like [text1] & [text2]. (Althought I think you have to type something in to get the combobox value.)

    Format this as a short date and it will behave a date.

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Where would the data be entered and by whom?
    I recommend you put a edit/validation routine on the Form involved.

    Can you tell us more about the requirement?

  4. #4
    cmwpcol is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2012
    Posts
    4
    The data is entered in the Expiration Date field that exists in a Form by our entry clerks.

    My thought is a validation routine is the way to go. However, I have never set up a validation rule. Not to mention, one with a variable which would be the year.

    For example, when the entry clerk enters a date of: 9/18/2013. I am looking for a reminder message to pop up saying: "The only dates allowed are 1/1, 4/1, or 2/1." If they enter a date of: 1/1/2013. A reminder message is not necessary. They can proceed to the next field in the form.

    I need the date they actually enter to include the applicable expiration year (which could be current year +1 (2013) or current year +2 (2014), etc.).

    I currently have a reminder line under this field in the form stating Only Applicable Dates: 1/1 or 4/1 (ASSG) or 2/1 (DSG).However, the entry clerks continually overlook this message as if it doesn't exist. I need to do something to force them to recognize these dates (month and day) are the only acceptable dates.

    I appreciate any suggestions you may have.

    Thank you!




  5. #5
    cmwpcol is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2012
    Posts
    4
    I'll give this a try.

    Thank you!!

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    If you only want the clerks to select certain values, then why not put those value in a combo box on the form, and Limit them to the List?

    When I suggested a validation routine, I was talking about a small vba routine to ensure the data met your criteria.
    But, as above, if you have only a few valid dates, put them in a combo.

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

Similar Threads

  1. Limiting list box by another field
    By lukebowes in forum Access
    Replies: 15
    Last Post: 05-21-2012, 12:12 AM
  2. Replies: 2
    Last Post: 02-23-2012, 12:23 PM
  3. Date Entry in formatted field
    By gg80 in forum Forms
    Replies: 2
    Last Post: 02-10-2012, 06:35 PM
  4. Replies: 4
    Last Post: 07-28-2010, 10:27 AM
  5. Date/Time entry field on a form
    By Ted C in forum Forms
    Replies: 1
    Last Post: 06-22-2010, 12:28 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