MS Access - VBA - Add 1 Month to Current Date

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shiznaw
    New Member
    • Jun 2007
    • 29

    MS Access - VBA - Add 1 Month to Current Date

    Private Function rprtdate()
    Dim rprtdates As Date
    Dim 1mnth As Integer

    1mnth= Month(Date) + Month(DateSeria l(Year(Date), Month(Date) + 1, Day(Date)))

    Select Case Frame35.Value
    'the following if end user choses one month from the day chosen for reporting period
    Case Is = 3
    rprtdates = Format(Calendar 1.Value, "mm/dd/yy", vbSunday)
    [Beginning] = rprtdates
    [ending] = rprtdates + 1mnth

    End Select
    End Function

    HELP ME find a method for adding 1 month to the current date!!! PLEASE !!
    Its the 1mnth that is the problem. the fields [beginning] & [ending] fields are okay. I'm new in coding the following methods and how they are used:

    dateserial()
    dateadd()
    format()

    If someone can just help me around this current problem with the 1mnth variable and guide me to some article regarding how to properly use the methods regarding dates.

    ITs DateAdd ("m", 1, [Date Field]) --isn't it. I am so freaking dumb

    ---shiznaw
    univ of utah
  • shiznaw
    New Member
    • Jun 2007
    • 29

    #2
    Originally posted by shiznaw
    Private Function rprtdate()
    Dim rprtdates As Date
    Dim 1mnth As Integer

    1mnth= Month(Date) + Month(DateSeria l(Year(Date), Month(Date) + 1, Day(Date)))

    Select Case Frame35.Value
    'the following if end user choses one month from the day chosen for reporting period
    Case Is = 3
    rprtdates = Format(Calendar 1.Value, "mm/dd/yy", vbSunday)
    [Beginning] = rprtdates
    [ending] = rprtdates + 1mnth

    End Select
    End Function

    HELP ME find a method for adding 1 month to the current date!!! PLEASE !!
    Its the 1mnth that is the problem. the fields [beginning] & [ending] fields are okay. I'm new in coding the following methods and how they are used:

    dateserial()
    dateadd()
    format()

    If someone can just help me around this current problem with the 1mnth variable and guide me to some article regarding how to properly use the methods regarding dates.

    ITs DateAdd ("m", 1, [Date Field]) --isn't it. I am so freaking dumb

    ---shiznaw
    univ of utah
    NEver mind...I'm an idiot. Its DateAdd() method. Took out the extra crap. Thanxs anyway.

    ---shiznaw, the Scripts Villiage Idiot

    Comment

    Working...