Results 1 to 13 of 13
  1. #1
    Mohaisen is offline Novice
    Windows 8 Access 2007
    Join Date
    Aug 2015
    Posts
    7

    help in validation rule


    Hi
    i'm creating a database for clinic and i want to add a validation rule for the date column no appointment's in friday

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,610
    IMHO validation is usually best done in a forms Before Update event. Are you using a form to Add/Edit data?
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    Mohaisen is offline Novice
    Windows 8 Access 2007
    Join Date
    Aug 2015
    Posts
    7
    Quote Originally Posted by Bob Fitz View Post
    IMHO validation is usually best done in a forms Before Update event. Are you using a form to Add/Edit data?
    actually i will add the data later
    and I want to add validation rule to the column date in the appointments table

  4. #4
    Mohaisen is offline Novice
    Windows 8 Access 2007
    Join Date
    Aug 2015
    Posts
    7
    could you help me to define this validation rule
    in the column date In design mode

  5. #5
    nick404's Avatar
    nick404 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2015
    Location
    Wisconsin
    Posts
    352
    I agree with putting it in forms BeforeUpdate event;
    however, in the table's design view try this in your date column's criteria
    Weekday(["your date field name"]) <> 6

  6. #6
    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,849
    If you do not want appointments on Friday (and Saturday and Sunday), I suggest code that tests this logic

    Weekday(Day(AppointmentDate)) Not In (5,6,1)

    OOOOops: I see Nick has posted while I was typing. The red above deals with Saturday and Sunday.

  7. #7
    Mohaisen is offline Novice
    Windows 8 Access 2007
    Join Date
    Aug 2015
    Posts
    7
    it does not work
    i want it just for "Friday"
    I use Microsoft office 2007

  8. #8
    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,849
    it does not work

    That doesn't help readers-- Did you get an error? Which It are you referring to?
    What exactly did you try? Show us a screen capture or code.

    I would use code in the form's before update event as others have said.

  9. #9
    Mohaisen is offline Novice
    Windows 8 Access 2007
    Join Date
    Aug 2015
    Posts
    7
    https://www.mediafire.com/?jxqdaajn3bxedcz

    this is a simple file contains a table name appointments ( ID , Date )
    could you please apply the validation rule to the file and re post it !
    many thanks

  10. #10
    nick404's Avatar
    nick404 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2015
    Location
    Wisconsin
    Posts
    352
    Cannot access, blocked at work. Can you attach to post as a zip file?

  11. #11
    Mohaisen is offline Novice
    Windows 8 Access 2007
    Join Date
    Aug 2015
    Posts
    7

  12. #12
    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,849
    Attached is jpg.
    You change the table(design) --property --validation Rule--validation text

    Note: Date is a reserved word in Access.
    Attached Thumbnails Attached Thumbnails Validation.jpg  

  13. #13
    Mohaisen is offline Novice
    Windows 8 Access 2007
    Join Date
    Aug 2015
    Posts
    7
    Quote Originally Posted by orange View Post
    Attached is jpg.
    You change the table(design) --property --validation Rule--validation text

    Note: Date is a reserved word in Access.

    thank you very much

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

Similar Threads

  1. Replies: 2
    Last Post: 06-16-2015, 03:52 AM
  2. Validation Rule
    By JeffGeorge in forum Forms
    Replies: 4
    Last Post: 02-27-2015, 04:12 PM
  3. Validation Rule
    By rbiggs in forum Forms
    Replies: 4
    Last Post: 08-23-2011, 05:24 PM
  4. Validation Rule Help!
    By confidego in forum Access
    Replies: 8
    Last Post: 07-20-2011, 12:54 PM
  5. Validation Rule
    By robomose in forum Access
    Replies: 1
    Last Post: 09-09-2009, 05:59 AM

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