Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21266

Month wrong

$
0
0
I have labels--H0 thru H11 and they all show a month name. However with the code i have it does'nt work properly. I want H0 to Show the month name for instance Nov--then when the month changes i want it to advance down and show the current month now--Dec. and each month the month in H11 will go to H0

H0---Nov
H1---Dec
H2---Jan
H3---Feb
thru H11

Private Sub Form_Load()
Dim MonthPart As Integer
Dim i As Integer
MonthPart = Month(Date)
For i = 0 To 11
Monlbl(i).Caption = UCase(MonthName((21 + i - MonthPart) Mod 12 + 1, True))
Next
Text1.Text = Format(Date, "yyyy")
End Sub

Thank you in advance....Brian

Viewing all articles
Browse latest Browse all 21266

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>