this is the code for calendar.
but i don`t get al the days als datai don`t get 7day`s but 6 days
1 2 3 4 5 6 7
1 9 10 11 12 13 14
1 16 17 18 19 3nz
Function fVulinMaand()
Dim iJaar As Integer
Dim iMaand As Integer
Dim iJaarVandaag As Integer
Dim iMaandVandaag As Integer
Dim iDagVandaag As Integer
Dim i As Integer
Dim j As Integer
On Error Resume Next
iJaarVandaag = Year(Date)
iMaandVandaag = Month(Date)
iDagVandaag = Day(Date)
iJaar = Me!cboJaar
iMaand = Me!cboMaand
iWeekdag = Weekday(DateSerial(iJaar, iMaand, 1))
iLaatsteDag = Day(DateSerial(iJaar, iMaand + 1, 1) - 1)
iWeekdag = iWeekdag Mod 7
If iWeekdag <= 0 Or iWeekdag > 6 Then
iWDagCorrectie = 1
Else
iWDagCorrectie = iWeekdag
End If
If iWDagCorrectie > 1 Then
For i = 1 To iWDagCorrectie - 1
Me("s" & i).Visible = False
Next i
End If
For i = iWDagCorrectie To iWDagCorrectie + iLaatsteDag - 1
If i Mod 7 = 0 Then
'i = i + 1
ElseIf i Mod 7 = 1 Then
i = i + 1
End If
If iLaatsteDag < i - iWeekdag + 1 Then
Exit For
End If
Me("s" & i).Visible = True
If iJaarVandaag = iJaar And iMaandVandaag = iMaand And iDagVandaag = (i - iWeekdag + 1) Then
Me("s" & i).BorderColor = 255
Me("s" & i).BorderWidth = 2
Else
Me("s" & i).BorderColor = 13821670
Me("s" & i).BorderWidth = 1
End If
Me("s" & i) = ""
Me("l" & i).BackStyle = 1
Me("l" & i).BorderStyle = 1
Me("l" & i).Caption = CStr(i - iWeekdag + 1)
Next i
j = i
For i = j To 41
If i Mod 7 = 0 Then
i = i + 2
ElseIf i Mod 7 = 1 Then
i = i + 1
End If
Me("s" & i).Visible = False
Next i
Me.Caption = " Activiteiten overzicht " & Me!tMaand
End Function
but i don`t get al the days als datai don`t get 7day`s but 6 days
1 2 3 4 5 6 7
1 9 10 11 12 13 14
1 16 17 18 19 3nz
Function fVulinMaand()
Dim iJaar As Integer
Dim iMaand As Integer
Dim iJaarVandaag As Integer
Dim iMaandVandaag As Integer
Dim iDagVandaag As Integer
Dim i As Integer
Dim j As Integer
On Error Resume Next
iJaarVandaag = Year(Date)
iMaandVandaag = Month(Date)
iDagVandaag = Day(Date)
iJaar = Me!cboJaar
iMaand = Me!cboMaand
iWeekdag = Weekday(DateSerial(iJaar, iMaand, 1))
iLaatsteDag = Day(DateSerial(iJaar, iMaand + 1, 1) - 1)
iWeekdag = iWeekdag Mod 7
If iWeekdag <= 0 Or iWeekdag > 6 Then
iWDagCorrectie = 1
Else
iWDagCorrectie = iWeekdag
End If
If iWDagCorrectie > 1 Then
For i = 1 To iWDagCorrectie - 1
Me("s" & i).Visible = False
Next i
End If
For i = iWDagCorrectie To iWDagCorrectie + iLaatsteDag - 1
If i Mod 7 = 0 Then
'i = i + 1
ElseIf i Mod 7 = 1 Then
i = i + 1
End If
If iLaatsteDag < i - iWeekdag + 1 Then
Exit For
End If
Me("s" & i).Visible = True
If iJaarVandaag = iJaar And iMaandVandaag = iMaand And iDagVandaag = (i - iWeekdag + 1) Then
Me("s" & i).BorderColor = 255
Me("s" & i).BorderWidth = 2
Else
Me("s" & i).BorderColor = 13821670
Me("s" & i).BorderWidth = 1
End If
Me("s" & i) = ""
Me("l" & i).BackStyle = 1
Me("l" & i).BorderStyle = 1
Me("l" & i).Caption = CStr(i - iWeekdag + 1)
Next i
j = i
For i = j To 41
If i Mod 7 = 0 Then
i = i + 2
ElseIf i Mod 7 = 1 Then
i = i + 1
End If
Me("s" & i).Visible = False
Next i
Me.Caption = " Activiteiten overzicht " & Me!tMaand
End Function