Results 1 to 2 of 2
  1. #1
    spider is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2013

    Date code needed

    Dear all,

    I am working on an HR database. I need to make month days equal to 26 days if the employee works from the beginning of the month until the end of the month.
    Our weekend is only during sundays. My problem is that sometimes we have 5 sundays so the working days are equal to 25 days while it should be 26.
    I have two textboxes: PaymentStartingDate & PaymentFinishingDate
    I need to check if the PaymentStartingDate is the first day of the month and if the PaymentFinishingDate is the last day of the month.
    If so, then the Duration will be 26 days automatically.

    Thank you in advance.


  2. #2
    spider is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2013
    I figured it out.. I used the below code:

    If PaymentStartingDate = dhFirstDayInMonth([PaymentStartingDate]) And PaymentFinishingDate = dhLastDayInMonth([PaymentFinishingDate]) Then

    Text32 = 26
    Hopefully you can benefit from this as well.


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

Similar Threads

  1. Replies: 7
    Last Post: 12-12-2012, 03:14 PM
  2. code needed to filter form using combo boxes
    By drjim in forum Programming
    Replies: 1
    Last Post: 06-29-2012, 01:50 PM
  3. Replies: 2
    Last Post: 03-27-2012, 01:59 AM
  4. Replies: 1
    Last Post: 11-21-2011, 01:09 AM
  5. Code needed when Database is Opened
    By Access_Headaches in forum Access
    Replies: 7
    Last Post: 08-13-2010, 01:03 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 - Senior Forums