Results 1 to 3 of 3
  1. #1
    BLFOSTER is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jun 2013
    Posts
    68

    Is Not Monday

    I have a form with a date field called [txtweekof]. The default value of [txtweekof] is Date(). The user must always pick a Monday date in order to run a weekly roster. What I want to do is show a message to user if the date in [txtweekof] is NOT a Monday. This is what I have and it looks good to me, but I get the message no matter what date I pick.




    If [txtWeekOf] <> vbMonday And [txtWeekOf].Visible Then
    vMsg = "Please Select the Correct Monday"
    End If

    have also tried (with the same results)

    Case [txtWeekOf] <> vbMonday And [txtWeekOf].Visible
    vMsg = "Please Select the Correct Monday"

  2. #2
    lfpm062010 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Location
    US
    Posts
    415
    You have to use function "DatePart" to get the day of week.
    http://www.techonthenet.com/access/f...e/datepart.php

    DatePart ("w", now()) it will return a value of 2 which is "vbMonday".

  3. #3
    BLFOSTER is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jun 2013
    Posts
    68
    Thanks! Works fine

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

Similar Threads

  1. Group By Week Starting Monday?
    By kestefon in forum Access
    Replies: 1
    Last Post: 02-06-2014, 06:33 PM
  2. Finding the first Monday of the year
    By snipe in forum Programming
    Replies: 8
    Last Post: 12-26-2013, 12:12 PM
  3. Parameter Value = Monday of the current week VBA
    By bcn1988 in forum Programming
    Replies: 4
    Last Post: 09-13-2013, 10:35 AM
  4. Replies: 2
    Last Post: 02-07-2012, 05:39 PM
  5. Replies: 1
    Last Post: 07-27-2010, 09:47 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