View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] shahzad4u_ksa@yahoo.com is offline
external usenet poster
 
Posts: 68
Default Input message problem for Date textbox

Dear Sir,

I have a userform with text box "DatePurchase" and other textboxes.
when I load my userform and when I entered the data it is working
fine,

the problem is this when I load the form for date entry and the form
is Empty and I want to close my form with close button (unload me)
command. it is showing pop up message (input message) "Input must be a
date in the format: 'dd/mmm/yyyy"

when I enter any date then press the close button then it closing.

Pls help me in this regard. I am using the following code.


Private Sub DatePurchase_exit(ByVal Cancel As MSForms.ReturnBoolean)

If Not IsDate(DatePurchase) Then
MsgBox "Input must be a date in the format: 'dd/mmm/yyyy'"
Cancel = True
Else
DatePurchase = Format(DatePurchase, "dd/mmm/yyyy")
End If
End Sub

waiting for response.

Regards