what is wrong

dino

Registered User.
Local time
Today, 05:47
Joined
Dec 13, 2013
Messages
21
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
 
this is the code for calendar.
but i don`t get al the days als datai don`t get 7day`s but 6 days
Zomg, zht nglsh is orble :( :banghead:

I thought you had it working?
http://www.access-programmers.co.uk/forums/showthread.php?t=258293

The reason it "breaks" is that you didnt do as I told you to do in that thread in the first place....

De reden dat het niet werkt, is omdat je niet (goed) gedaan heb wat ik je in de andere post al verteld heb....
 
it like so to work but it goin
so the question now
 
As you can see, these are the date s that not working good 28 and 29.
He gives as 1-1-1 March 2013 and not 1-2-13 Sunday 2 February is completely gone.
oke dat is i small problem but what?
 

Attachments

  • agenda.png
    agenda.png
    22.5 KB · Views: 118
I am not going to repeat myself, so I will go as far as to quote myself

This part is what makes the form/code skip the saturdays and sundays, make sure to comment them out by adding the ' in front of the lines like I did below

// Dit deel van de code zorgt er voor dat de zaterdagen en zondagen overgeslagen worden, zet voor elk van deze regels een ' zoals ik hieronder gedaan heb
Code:
'        If i Mod 7 = 0 Then
'            i = i + 2
'        ElseIf i Mod 7 = 1 Then
'            i = i + 1
'        End If
Go into the code and place a "stop" at the start, then with F8 try and execute each line and see what it does to your form... Try and figure out from there what minor tweaks you need to do to get it to work...
Keep in mind that there are 35 labels and checkboxes, i in the code is the number of the box that is getting manipulated at the time....

// Ga in de code (met ALT + F11) en type een stop in de SUB, blader dan met de knoppen op de form en executeer de regels 1 voor 1 met F8 and probeer er achter te komen wat elke regel doet door goed op het form te letten terwijl je de regel excuteerd met F8. Er zijn 35 boxen en labels met de variable i wordt bestuurd welke van die labels en textboxen worden aangepast....

Success
 
Oke thanks it`s like to work
but is it possible , if the date from the next month come in display, that he se this als new date next month.

So yes what must I do
 
Visible = False
THis makes things hidden/invisible...
 
yes i know but the couting is not working, so you can see in th month Februari 28 day`s but hy count 28 and then 25 26 27 28 29 30 31

and the newe date for martch the 1 is if i loke 1-1-2014 and not 1-3
 
Which is because....
For i = iWDagCorrectie To iWDagCorrectie + iLaatsteDag - 1
...
next i

Only loops untill iLaatsteDag, i.e. the last day of the month
 

Users who are viewing this thread

Back
Top Bottom