I have two textboxes in which users enter a number, Data1.text and Data2.text. I need to do a simple check before proceeding and closing a form, i.e. the process should check if the sum of the values in Data1 and Data2 textbox is greater or lesser than the value from a label text named FinalValue.text, which gets its value from my main form.
If Data1.Text + Data2.Text <> FinalValue.Text Then
MessageBox.Show("The sum of the entered values are different from the final value!")
Exit Sub
End If
The problem is that whatever the user enters in the two textboxes, the messagebox pops up.
For example...if the FinalValue label has a value of 58.50, and if the user enters in one textbox 50 and in the other one 8.50, the messagebox pops up. I suppose I have to format my textboxes or something like that, but not sure in which way.
Thanks,