Hi all!
I have these Subs for calculating the Date and Weekday. The weekday works well(Mon-Sun).Now I have probs with the date..it starts from today to fill in. For example, instead of (mon-27th, tues-28th...), it shows(monday-29th, tues-30,wed-01 december).How can i make it to work correctly?
Option Explicit
Private Sub Form_Load()
Call LoadDaysOfWeek
Call LoadDate
End Sub
Private Sub LoadDaysOfWeek()
' Displays Days Of The Week
Dim i As Integer
For i = 0 To 5
Load txtwkdayname(txtwkdayname.UBound + 1)
txtwkdayname(txtwkdayname.UBound).Top = (txtwkdayname(i).Top + txtwkdayname(i).Height) + 8
txtwkdayname(txtwkdayname.UBound).Visible = True
Next i
For i = 1 To 7
txtwkdayname(i - 1) = WeekdayName(i, False, vbUseSystemDayOfWeek)
Next i
End Sub
Private Sub LoadDate()
' Displays Date
Dim i As Integer
For i = 0 To 5
Load txtDate(txtDate.UBound + 1)
txtDate(txtDate.UBound).Top = (txtDate(i).Top + txtDate(i).Height) + 8
txtDate(txtDate.UBound).Visible = True
Next i
For i = 1 To 7
Date = Now()
txtDate(i - 1).Text = DateAdd("d", i - 1, Date)
Next i
Enter your message below
Sign in or Join us (it's free).