Hi, I am using a MSDE database. I have several fields that are set to money in the database and when I generated the dataset they say decimal. Which is fine. However, On each of my text fields I wanted the user to put in a whole nuber if they did not it would round up to the nearest whole number. So what I did was the following.
Private Sub txtWages_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtWages.Leave
txtWages.BackColor = System.Drawing.Color.White
If txtWages.Text <> "" Then
Dim TaxValue As New Decimal()
TaxValue = Me.txtWages.Text
Me.txtWages.Text = String.Format("{0:f2}", TaxValue)
End If
End Sub
My problem comes when a user does not need to enter data on that line. They can skip all over the form if they like and enter just the fields needed. I could put a default value in the text of each text box but really dont want to is there another option.
Private Sub txtWages_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtWages.Leave
txtWages.BackColor = System.Drawing.Color.White
If txtWages.Text <> "" Then
Dim TaxValue As New Decimal()
TaxValue = Me.txtWages.Text
Me.txtWages.Text = String.Format("{0:f2}", TaxValue)
End If
End Sub
My problem comes when a user does not need to enter data on that line. They can skip all over the form if they like and enter just the fields needed. I could put a default value in the text of each text box but really dont want to is there another option.