Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    tkbeard29 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Posts
    17
    Correct, I'm displaying the StatementDate and the control is also named StatementDate. I changed the control to txtStatementDate as you suggested but and now when I enter 1/14/13 as the StatementDate I get the ServicePeriod result of 02/2013. So I should be able to change the sign and it should be good to go.... I think.

    I'm trying to figure out how to do single step code, but no luck right now.
    I'm a self-taught coder/database builder guy... using both terms lightly... with a book as a reference and learning as I go.

  2. #17
    tkbeard29 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Posts
    17
    Changed it to:

    Code:
    Private Sub txtStatementDate_AfterUpdate()
        If Day([StatementDate]) <= 14 Then
        [ServicePeriod] = DateSerial(Year([StatementDate]), Month([StatementDate]), 1)
       Else
        [ServicePeriod] = DateSerial(Year([StatementDate]), (Month([StatementDate]) + 1), 1)
       End If
    And it works great. I even tested it with December dates and it works as well. 12/16/13 Statement date resulted 01/2014 ServicePeriod.

    I think it's safe to say now that this has been solved.

    Thanks again for your help, it's greatly appreciated!!!!!!!

  3. #18
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Evindently, DateSerial changes Month(12)+1 into Month(1). Interesting.

  4. #19
    tkbeard29 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Posts
    17
    Quote Originally Posted by RuralGuy View Post
    Evindently, DateSerial changes Month(12)+1 into Month(1). Interesting.
    Happy music to my ears and eyes.... I'll take it. haha.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Alert on Existing Date Period
    By waqas in forum Access
    Replies: 5
    Last Post: 02-03-2013, 10:38 PM
  2. Replies: 3
    Last Post: 12-04-2012, 05:22 PM
  3. Calculating a date range
    By unicorn in forum Queries
    Replies: 6
    Last Post: 01-18-2012, 08:58 AM
  4. Calculating Expiry Date -
    By Jojojo in forum Programming
    Replies: 12
    Last Post: 10-05-2011, 12:05 PM
  5. Getting Tax Period from current date
    By crxftw in forum Forms
    Replies: 3
    Last Post: 07-09-2011, 07:12 AM

Tags for this Thread

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