Using the following code, every time I hit the submit button the values all go back to 0
If txtBedrooms.Text = String.Empty Then
MessageBox.Show("Please enter a bedroom 0 or greater")
Exit Sub
ElseIf Not IsNumeric(txtBedrooms.Text) Then
MessageBox.Show("Please enter a bedroom 0 or greater")
Exit Sub
ElseIf txtBedrooms.Text < 0 Then
MessageBox.Show("Please enter a bedroom 0 or greater")
Exit Sub
Else
txtBedrooms.Text = bedrooms.ToString
End If
Where am I going wrong?
Have you set a value for bedrooms? It is not in the code you submitted?
I “think” you are trying to set bedrooms to the value of txtBedrooms.
If that is the case, the assignment is the wrong way round and needs switching to