Antwoorden

1. De knoppen VOLGENDE en VORIGE worden bij de gebeurtenis bij klikken gekoppeld aan respectievelijk de functies volgende() en vorige()

objecta4.jpg (10400 bytes)

Function volgende()
On Error GoTo fout
DoCmd.GoToRecord , , acNext
terug:
Exit Function
fout:
DoCmd.GoToRecord , , acFirst
Resume terug
End Function

 

Function vorige()
On Error GoTo fout
DoCmd.GoToRecord , , acPrevious
terug:
Exit Function
fout:
DoCmd.GoToRecord , , acLast
Resume terug
End Function

2. Met de functie Str(getal) wordt een numerieke waarde in een tekst omgezet. CVDate("2/3/1998") zet een datum als string om in een datewaarde.

Function dagen()
Dim maand As String, jaar As String, teller As Integer, strdatum As String, datum As Date
maand = InputBox("welke maand")
jaar = InputBox("welke jaar")
For teller = 1 To 32
strdatum = Str(teller) + "/" + maand + "/" + jaar
On Error GoTo afdruk
datum = CVDate(strdatum)
Next teller
einde:
Exit Function

afdruk:
MsgBox "aantal dagen" + Str(teller - 1)
Resume einde
End Function