vrientschap
Nieuwe gebruiker
- Lid geworden
- 21 mei 2010
- Berichten
- 3
met onderstaande code kan de som, verschil, product en deling berekend worden, het probleem is dat als ik als 1ste getal 10 en 2de getal 2 ingeef, ik bij de som 102 uitkom, waar zit dan juist de fout,en als het 2de getal een nul is zou hij een melding moeten geven, maar de code is dan blijkbaar niet juist,
alvast bedankt
Private Sub cmdBereken_Click()
Dim Getal1 As Single
Dim Getal2 As Single
Dim Som As Single
Dim Verschil As Single
Dim Deling As Single
Dim Product As Single
txtSom = txtG1 + txtG2
txtVerschil = txtG1 - txtG2
txtProduct = txtG1 * txtG2
txtDeling = txtG1 / txtG2
If txtG2 = 0 Then
MsgBox ("deze bewerking gaat niet")
End If
Getal1 = txtG1.Text
Getal2 = txtG2.Text
Som = txtSom.Text
Verschil = txtVerschil.Text
Product = txtProduct.Text
Deling = txtDeling.Text
End Sub
Private Sub txtG1_Change()
End Sub
Private Sub txtSom_Change()
End Sub
alvast bedankt
Private Sub cmdBereken_Click()
Dim Getal1 As Single
Dim Getal2 As Single
Dim Som As Single
Dim Verschil As Single
Dim Deling As Single
Dim Product As Single
txtSom = txtG1 + txtG2
txtVerschil = txtG1 - txtG2
txtProduct = txtG1 * txtG2
txtDeling = txtG1 / txtG2
If txtG2 = 0 Then
MsgBox ("deze bewerking gaat niet")
End If
Getal1 = txtG1.Text
Getal2 = txtG2.Text
Som = txtSom.Text
Verschil = txtVerschil.Text
Product = txtProduct.Text
Deling = txtDeling.Text
End Sub
Private Sub txtG1_Change()
End Sub
Private Sub txtSom_Change()
End Sub