I know I am new and this prolly a dumb question... I have no BS been working on this issue for the last 5 HOURS!!! Some one gimme a little insight PLEASE!
This is the error I get:
Conversion from string "" to type 'Double' is not valid.
on this line:
TextBox3.Text = TextBox1.Text * TextBox2.Text
And this is my code...
What am I doing wrong?
Public Class Form1
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
End 'closes the program
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
'clears everything
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
Me.CheckBox1 = Me.CheckBox1
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox3.Text = TextBox1.Text * TextBox2.Text 'subtotal
If TextBox4.Text > 0 Then 'if the check box is checked adds electricity
TextBox5.Text = TextBox3.Text + TextBox4.Text
Else : TextBox5.Text = TextBox3.Text 'if not checked it skips electricity
End If
If DateDiff("d", Me.DateTimePicker1, Me.DateTimePicker2) < 1 Then 'error message for date problems
MsgBox("Start Date can not be before End Date")
End If
End Sub
Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
TextBox2.Text = 25.0 'cheap
End Sub
Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged
TextBox2.Text = 35.0 'middle price
End Sub
Private Sub RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton3.CheckedChanged
TextBox2.Text = 50.0 'most expensive
End Sub
Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
TextBox4.Text = TextBox1.Text * 10 'adds electricity charges
End Sub
Private Sub TextBox5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox5.TextChanged
TextBox5.Text = Format(TextBox5.Text, "currency")
If TextBox4.Text > 0 Then 'if there is an electric charge then add the two together
TextBox5.Text = TextBox3.Text = TextBox4.Text
Else 'if not then just repeat the same number
TextBox5.Text = TextBox3.Text
End If
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
TextBox1.Text = DateDiff("d", Me.DateTimePicker1, Me.DateTimePicker2)
End Sub
Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
TextBox2.Text = Format(TextBox2.Text, "currency")
End Sub
Private Sub TextBox3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox3.TextChanged
TextBox3.Text = Format(TextBox3.Text, "currency")
End Sub
Private Sub TextBox4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox4.TextChanged
TextBox4.Text = Format(TextBox4.Text, "currency")
End Sub
End Class