Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel 2007 textbox exit event does not work

Status
Not open for further replies.

gustaf111

Programmer
Jan 16, 2011
87
SE
Hello,

I can not get the Exit event on a textbox working on Excel 2007.

Private Sub TextBox1_Exit()
MsgBox ("Test")
End Sub

I would like to validate that the input in the textbox is a valid date, are there any system functions ?

Thanks Gustaf


 


hi,

WHERE is your text box?


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Hello Skip,

It is on a a excel sheet

Thanks Gustaf
 


Where do you see the Exit Event?

Do you see the LostFocus event?

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
I just changed to new excel sheet! And there the LostFocus evnt works! Thanks Skip!

Do you now how to valide the string to a valid date ?
 



I do not recommend alloing users to enter dates in a text box. Why not a Date Picker or separate dependent fields for year, month & day?

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
ohh! Okay. What is the reason ?

I will think aboyt it, but I would prefer to input date like: 2011-09-14 .....
 


Can you be assured, with certainty that your user(s) will always enter dates that are unambiguous or can be interpreted for validation?

for instance, date string entered in dd-mm-yyyy structure WILL be converted in a manner not expected and dates can also be entered using alpha months.

When have you ever entered a date into a professionally managed system that accepted free form strings? I have not!

I'd use a DatePicker control. SIMPLE!!!

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top