Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21246

Clear textbox issue

$
0
0
Good morning,
I have a few textboxes that the user places dates into. These boxes have a lostfocus sub to convert whats entered into a date.
Code:

Private Sub txtDueDate_LostFocus()
    If IsDate(txtDueDate.Text) Then
        txtDueDate.Text = Format(txtDueDate.Text, "m/d/yyyy")
    End If
End Sub

Now I have a command button that should out these boxes when clicked using the below
Code:


txtDueDate.Text = ""

However it is not clearing out the box. It leaves the date in the box.

I assume its because it doesn't want to accept a null value, therefore leaves the date in the box. Any suggestions?

Viewing all articles
Browse latest Browse all 21246

Trending Articles