Results 1 to 1 of 1

Thread: MonthCalendar SetDate [resolved]

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2003
    Location
    US
    Posts
    68

    MonthCalendar SetDate [resolved]

    is there a better way to do this, it looks so cheesy
    it grabs the first of this month and 1st of last month using monthcalendars

    VB Code:
    1. Dim dtMonth, dtMonth2, dtYear, dtYear2 As Int16
    2.         dtMonth = Format(MC2.TodayDate, "MM")
    3.         dtYear = Format(MC2.TodayDate, "yyyy")
    4.         dtYear2 = dtYear
    5.         'get last months number
    6.         dtMonth2 = dtMonth - 1
    7.         ' if month = january
    8.         If dtMonth2 = 0 Then
    9.             dtMonth2 = 12
    10.             dtYear2 -= 1
    11.         End If
    12.         'set monthcalender
    13.         MC1.SetDate(dtMonth2 & "/1/" & dtYear2)
    14.         MC2.SetDate(dtMonth & "/1/" & dtYear)

    but then again it does work
    Last edited by NeonBurner; Jan 7th, 2004 at 06:56 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
  •  



Click Here to Expand Forum to Full Width