Goede middag,
Ik maak weer een nieuw topic aan, omdat het vorige terecht op slot is gegaan, maar nu kan ik het wat beter uitleggen:
Voor degene die het nog niet gelezen hadden: Ik heb een opdracht van school en dat is Yahtzee maken in VBA.
Tot nu toe mijn code:
------------------------------
Option Compare Database
Dim Teller As Byte
Private Sub Dobbel1_Click()
Me.Dobbelselect1.Value = True
End Sub
Private Sub Dobbel2_Click()
Me.Dobbelselect2.Value = True
End Sub
Private Sub Dobbel3_Click()
Me.Dobbelselect3.Value = True
End Sub
Private Sub Dobbel4_Click()
Me.Dobbelselect4.Value = True
End Sub
Private Sub Dobbel5_Click()
Me.Dobbelselect5.Value = True
End Sub
Private Sub Dobbelen_Click()
If Teller < 3 Then
If Me.Dobbelselect1.Value = False Then Me.Dobbel1.Caption = (Int(Rnd * 6) + 1)
If Me.Dobbelselect2.Value = False Then Me.Dobbel2.Caption = (Int(Rnd * 6) + 1)
If Me.Dobbelselect3.Value = False Then Me.Dobbel3.Caption = (Int(Rnd * 6) + 1)
If Me.Dobbelselect4.Value = False Then Me.Dobbel4.Caption = (Int(Rnd * 6) + 1)
If Me.Dobbelselect5.Value = False Then Me.Dobbel5.Caption = (Int(Rnd * 6) + 1)
Teller = Teller + 1
If Teller = 3 Then
MsgBox "Next player"
Teller = 0
End If
If Me.Dobbel1.Caption = 1 Then Score1 = Score1 + 1
If Me.Dobbel2.Caption = 1 Then Score1 = Score1 + 1
If Me.Dobbel3.Caption = 1 Then Score1 = Score1 + 1
If Me.Dobbel4.Caption = 1 Then Score1 = Score1 + 1
If Me.Dobbel5.Caption = 1 Then Score1 = Score1 + 1
Me.Eenen.Value = Score1
If Me.Dobbel1.Caption = 2 Then Score2 = Score2 + 1
If Me.Dobbel2.Caption = 2 Then Score2 = Score2 + 1
If Me.Dobbel3.Caption = 2 Then Score2 = Score2 + 1
If Me.Dobbel4.Caption = 2 Then Score2 = Score2 + 1
If Me.Dobbel5.Caption = 2 Then Score2 = Score2 + 1
Me.tweeen.Value = Score2
If Me.Dobbel1.Caption = 3 Then Score3 = Score3 + 1
If Me.Dobbel2.Caption = 3 Then Score3 = Score3 + 1
If Me.Dobbel3.Caption = 3 Then Score3 = Score3 + 1
If Me.Dobbel4.Caption = 3 Then Score3 = Score3 + 1
If Me.Dobbel5.Caption = 3 Then Score3 = Score3 + 1
Me.Drieen.Value = Score3
If Me.Dobbel1.Caption = 4 Then Score4 = Score4 + 1
If Me.Dobbel2.Caption = 4 Then Score4 = Score4 + 1
If Me.Dobbel3.Caption = 4 Then Score4 = Score4 + 1
If Me.Dobbel4.Caption = 4 Then Score4 = Score4 + 1
If Me.Dobbel5.Caption = 4 Then Score4 = Score4 + 1
Me.Vieren.Value = Score4
If Me.Dobbel1.Caption = 5 Then Score5 = Score5 + 1
If Me.Dobbel2.Caption = 5 Then Score5 = Score5 + 1
If Me.Dobbel3.Caption = 5 Then Score5 = Score5 + 1
If Me.Dobbel4.Caption = 5 Then Score5 = Score5 + 1
If Me.Dobbel5.Caption = 5 Then Score5 = Score5 + 1
Me.Vijven.Value = Score5
If Me.Dobbel1.Caption = 6 Then Score6 = Score6 + 1
If Me.Dobbel2.Caption = 6 Then Score6 = Score6 + 1
If Me.Dobbel3.Caption = 6 Then Score6 = Score6 + 1
If Me.Dobbel4.Caption = 6 Then Score6 = Score6 + 1
If Me.Dobbel5.Caption = 6 Then Score6 = Score6 + 1
Me.Zessen.Value = Score6
If Me.Eenen.Value = 3 Then Me.Kind.Visible = True
End If
End Sub
Private Sub Tekst31_Click()
Private Sub Tweeen_Click()
End Sub
-----------------
Ik hoop dat het een beetje duidelijk is zo en nu moet ik nog 4 spelers toevoegen, maar ik weet niet echt hoe ik dat moet doen.
Ik maak weer een nieuw topic aan, omdat het vorige terecht op slot is gegaan, maar nu kan ik het wat beter uitleggen:
Voor degene die het nog niet gelezen hadden: Ik heb een opdracht van school en dat is Yahtzee maken in VBA.
Tot nu toe mijn code:
------------------------------
Option Compare Database
Dim Teller As Byte
Private Sub Dobbel1_Click()
Me.Dobbelselect1.Value = True
End Sub
Private Sub Dobbel2_Click()
Me.Dobbelselect2.Value = True
End Sub
Private Sub Dobbel3_Click()
Me.Dobbelselect3.Value = True
End Sub
Private Sub Dobbel4_Click()
Me.Dobbelselect4.Value = True
End Sub
Private Sub Dobbel5_Click()
Me.Dobbelselect5.Value = True
End Sub
Private Sub Dobbelen_Click()
If Teller < 3 Then
If Me.Dobbelselect1.Value = False Then Me.Dobbel1.Caption = (Int(Rnd * 6) + 1)
If Me.Dobbelselect2.Value = False Then Me.Dobbel2.Caption = (Int(Rnd * 6) + 1)
If Me.Dobbelselect3.Value = False Then Me.Dobbel3.Caption = (Int(Rnd * 6) + 1)
If Me.Dobbelselect4.Value = False Then Me.Dobbel4.Caption = (Int(Rnd * 6) + 1)
If Me.Dobbelselect5.Value = False Then Me.Dobbel5.Caption = (Int(Rnd * 6) + 1)
Teller = Teller + 1
If Teller = 3 Then
MsgBox "Next player"
Teller = 0
End If
If Me.Dobbel1.Caption = 1 Then Score1 = Score1 + 1
If Me.Dobbel2.Caption = 1 Then Score1 = Score1 + 1
If Me.Dobbel3.Caption = 1 Then Score1 = Score1 + 1
If Me.Dobbel4.Caption = 1 Then Score1 = Score1 + 1
If Me.Dobbel5.Caption = 1 Then Score1 = Score1 + 1
Me.Eenen.Value = Score1
If Me.Dobbel1.Caption = 2 Then Score2 = Score2 + 1
If Me.Dobbel2.Caption = 2 Then Score2 = Score2 + 1
If Me.Dobbel3.Caption = 2 Then Score2 = Score2 + 1
If Me.Dobbel4.Caption = 2 Then Score2 = Score2 + 1
If Me.Dobbel5.Caption = 2 Then Score2 = Score2 + 1
Me.tweeen.Value = Score2
If Me.Dobbel1.Caption = 3 Then Score3 = Score3 + 1
If Me.Dobbel2.Caption = 3 Then Score3 = Score3 + 1
If Me.Dobbel3.Caption = 3 Then Score3 = Score3 + 1
If Me.Dobbel4.Caption = 3 Then Score3 = Score3 + 1
If Me.Dobbel5.Caption = 3 Then Score3 = Score3 + 1
Me.Drieen.Value = Score3
If Me.Dobbel1.Caption = 4 Then Score4 = Score4 + 1
If Me.Dobbel2.Caption = 4 Then Score4 = Score4 + 1
If Me.Dobbel3.Caption = 4 Then Score4 = Score4 + 1
If Me.Dobbel4.Caption = 4 Then Score4 = Score4 + 1
If Me.Dobbel5.Caption = 4 Then Score4 = Score4 + 1
Me.Vieren.Value = Score4
If Me.Dobbel1.Caption = 5 Then Score5 = Score5 + 1
If Me.Dobbel2.Caption = 5 Then Score5 = Score5 + 1
If Me.Dobbel3.Caption = 5 Then Score5 = Score5 + 1
If Me.Dobbel4.Caption = 5 Then Score5 = Score5 + 1
If Me.Dobbel5.Caption = 5 Then Score5 = Score5 + 1
Me.Vijven.Value = Score5
If Me.Dobbel1.Caption = 6 Then Score6 = Score6 + 1
If Me.Dobbel2.Caption = 6 Then Score6 = Score6 + 1
If Me.Dobbel3.Caption = 6 Then Score6 = Score6 + 1
If Me.Dobbel4.Caption = 6 Then Score6 = Score6 + 1
If Me.Dobbel5.Caption = 6 Then Score6 = Score6 + 1
Me.Zessen.Value = Score6
If Me.Eenen.Value = 3 Then Me.Kind.Visible = True
End If
End Sub
Private Sub Tekst31_Click()
Private Sub Tweeen_Click()
End Sub
-----------------
Ik hoop dat het een beetje duidelijk is zo en nu moet ik nog 4 spelers toevoegen, maar ik weet niet echt hoe ik dat moet doen.