Onderstaande code geeft de foutmelding "Case without select case". Weet iemand waar de fout in deze code zit?
Alvast bedankt!
Alvast bedankt!
Code:
[COLOR="#0000FF"][I][I]Private Sub cmdBerekenen_Click()
Dim strResultaat As String
Dim intLeeftijd As Integer
Dim intProduct As Integer
Dim intTeller As Integer
strResultaat = ""
Select Case True
Case txtLeeftijd.Text = ""
strResultaat = "Vul eerst een getal in"
Case Not (IsNumeric(txtLeeftijd.Text))
strResultaat = "U mag enkel een getal invoeren"
Case txtLeeftijd.Text < 5
strResultaat = "U bent te jong voor zakgeld"
Case txtLeeftijd.Text > 21
strResultaat = "U bent te oud voor zakgeld"
Case optActie1.Value = True
For intTeller = 5 To Val(txtLeeftijd.Text)
intTeller = intTeller * intZakgeld
strResultaat = strResultaat & Int(intTeller) & " : " & Str(intProduct) & vbCrLf
Case optActie2.Value = True
For intTeller = 5 To Val(txtLeeftijd.Text)
intProduct = intTeller * intZakgeld + 2
strResultaat = strResultaat & Int(intTeller) & " : " & Str(intProduct) & vbCrLf
Next intTeller
End Select
txtResultaat.Text = strResultaat
intLeeftijd = DateDiff("yyyy", txtLeeftijd, Date)
End Sub[/I][/COLOR]
Laatst bewerkt door een moderator: