Results 1 to 5 of 5
  1. #1
    Delta729 is offline Advanced Beginner
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Nov 2010
    Location
    Los Angeles
    Posts
    95

    Last day in month

    I have a form field called "txtDateBeg", which is just a short date field that can have date typed into the field.



    I have another field called "txtDateEnd", which I'm trying to have equaled to the last day of the month for whatever is typed in the first field "txtDateBeg". It's nothing that's going to be stored, just after the update as a reminder what the last day of the month is based on the date keyed in.

    (I know this is really simple, I can't think of what's its called, I can't seem to find anything online).

    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,652
    =DateSerial(Year(dte), Month(dte) + 1, 0)

    Where dte is the input date.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Delta729 is offline Advanced Beginner
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Nov 2010
    Location
    Los Angeles
    Posts
    95
    Perfect, thank you.

    =DateSerial(Year([txtDateBeg]),Month([txtDateBeg])+1,0)

    I thought there was something like what Excel had for EOM function.

  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,652
    Happy to help.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Quote Originally Posted by Delta729 View Post
    I thought there was something like what Excel had for EOM function.
    There is....
    A UDF, but you have to add the function to a standard module. Then you use it just like you would with the Excel EOM function.
    Code:
    Function GetEOM(pTheDate As Date) As Date
       GetEOM = DateSerial(Year(pTheDate), Month(pTheDate)+1, 0)
    End Function

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

Similar Threads

  1. Replies: 3
    Last Post: 12-29-2014, 10:14 AM
  2. Replies: 5
    Last Post: 10-08-2014, 02:23 PM
  3. Replies: 43
    Last Post: 08-06-2014, 08:21 PM
  4. Replies: 5
    Last Post: 06-17-2014, 12:11 AM
  5. Replies: 6
    Last Post: 05-05-2014, 10:51 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