View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Tdp Tdp is offline
external usenet poster
 
Posts: 74
Default TextBox will not clear date???????????

THi,
I have a Textbox when entered a date, it adds 90 days and 120 days to that
date and enteres these dates to two more textboxes.
The trouble I am having is when a date is entered in error in the first
Textbox I can not clear it. The cursor freezes. Any ideas?
The code I am using is as follows:

Private Sub TextBox36_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
TextBox36.Value = Format(TextBox36.Value, "dd-mmm-yy")
If IsDate(Me.TextBox36.Value) Then
Me.TextBox37.Value _
= Format(CDate(Me.TextBox36.Value) + 90, "dd-mmm-yy")
Me.TextBox38.Value _
= Format(CDate(Me.TextBox36.Value) + 120, "dd-mmm-yy")
Else
Beep
Cancel = True
End If
End Sub

Tdp