Results 1 to 4 of 4
  1. #1
    mbenton's Avatar
    mbenton is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jul 2015
    Posts
    73

    Is it possible to create conditional formatting on date/time field.

    Hello, I have a date/time field on a form. I would like for this field to highlight (or pop up message box) if the date and time are outside of our business hours, which would be >= 0200 - 0600 or weekends. Is it possible to do this using conditional formatting, or does it require vb coding? Thanks.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Should be possible, using OR. Test for a weekend with Weekday(), then test for time. You could also use VBA, but I wouldn't think it's necessary if you don't want to use it. The message box would require it though (or a macro I suppose).
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    mbenton's Avatar
    mbenton is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jul 2015
    Posts
    73
    Thanks, I've not been successful in getting that to work. It's a date and time field combined.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    What have you tried? You'd also want the TimeValue() function for the time test.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 11
    Last Post: 12-08-2015, 11:47 AM
  2. Replies: 7
    Last Post: 03-03-2014, 01:36 PM
  3. how to apply Conditional Formatting in run time
    By selvakumar.arc in forum Forms
    Replies: 7
    Last Post: 07-03-2013, 12:41 PM
  4. Date Conditional Formatting
    By f15avionics in forum Access
    Replies: 3
    Last Post: 09-21-2012, 04:45 AM
  5. Date and time formatting when pulling from a form field
    By avarusbrightfyre in forum Programming
    Replies: 3
    Last Post: 09-15-2011, 04:20 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