View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Titus[_3_] Titus[_3_] is offline
external usenet poster
 
Posts: 9
Default Force TextBox to hold time ("hh:mm")

Still Need Help!

Can anyone help?

I'm having a great deal of difficulty trying to have my TextBox display
time ("hh:mm") on a UserForm that I created. The TextBox will take the
time correctly, but when the UserForm re-opens it displays the time as
numbers not in the time format. It will only display the time once I
click in and them out of the TextBox. This will be too confusing for
my users!

My VBA code is attached to both the TextBox and the UserForm, on the
TimeTextBox1 I am using the following code:

Private Sub TimeTextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
TimeTextBox1.Value = Format(TimeTextBox1.Value, "hh:mm")
End Sub

I am using a separate macro that runs the UserForm which actatives the
UserForm that has the following code:

Private Sub UserForm_Activate()
UserForm1.TimeTextBox1.Value =
Format(FrmNotifUpdate.TimeTextBox1.Value, "hh:mm")
End Sub

Thanks for your help!
RES