fadib
11-09-2007, 12:30 PM
This is the code that i have.
Private Sub CommandButton1_Click()
If CheckBox1.Value = False And CheckBox2.Value = False Then
TextBox3.Text = 0
End If
If CheckBox1.Value = True Then
TextBox3.Text = TextBox1.Text
Else
If CheckBox2.Value = True Then
TextBox3.Text = TextBox2.Text
End If
End If
If CheckBox1.Value = True And CheckBox2.Value = True Then
TextBox3.Text = CVar(TextBox1.Text) + CVar(TextBox2.Text)
End If
End Sub
The problem that I have is the values are not being added. it seems they are kept as strings.
how can I add the values together, and not just display the values next to each other?:banghead:
Private Sub CommandButton1_Click()
If CheckBox1.Value = False And CheckBox2.Value = False Then
TextBox3.Text = 0
End If
If CheckBox1.Value = True Then
TextBox3.Text = TextBox1.Text
Else
If CheckBox2.Value = True Then
TextBox3.Text = TextBox2.Text
End If
End If
If CheckBox1.Value = True And CheckBox2.Value = True Then
TextBox3.Text = CVar(TextBox1.Text) + CVar(TextBox2.Text)
End If
End Sub
The problem that I have is the values are not being added. it seems they are kept as strings.
how can I add the values together, and not just display the values next to each other?:banghead: