Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
SetFocus method in VBA
I'm trying to do some data validation during
the 'LostFocus' event of a textbox. If the validation test fails, I want to return the user to the textbox. I'm trying 'txtAmount.SetFocus' which I found in the MSDN, but I'm getting an error that the method is not supported by the object. Has SetFocus method been removed from Office XP? If not, what's the syntax and how can I make it work? Robin |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
SetFocus method in VBA
Setfocus is still supported; I'm using it in my own projects (Access).
If I find out possible reason(s) why the method may not work, I'll post so later. Randall Arnold "Robin S." wrote in message ... I'm trying to do some data validation during the 'LostFocus' event of a textbox. If the validation test fails, I want to return the user to the textbox. I'm trying 'txtAmount.SetFocus' which I found in the MSDN, but I'm getting an error that the method is not supported by the object. Has SetFocus method been removed from Office XP? If not, what's the syntax and how can I make it work? Robin |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
SetFocus method in VBA
Robin:
It looks like the Textbox used with MSForms does not support Setfocus (or Gotfocus either). However, the Control object (from the Controls collection) does. I suspect that can be used to enumerate the particular textbox you want and use its Setfocus method. In fact, the more I think about it, I believe I've seen this referenced somewhere... Randall Arnold "Randall Arnold" wrote in message ... Setfocus is still supported; I'm using it in my own projects (Access). If I find out possible reason(s) why the method may not work, I'll post so later. Randall Arnold "Robin S." wrote in message ... I'm trying to do some data validation during the 'LostFocus' event of a textbox. If the validation test fails, I want to return the user to the textbox. I'm trying 'txtAmount.SetFocus' which I found in the MSDN, but I'm getting an error that the method is not supported by the object. Has SetFocus method been removed from Office XP? If not, what's the syntax and how can I make it work? Robin |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Please post this thread a correct full method, method about | New Users to Excel | |||
Please post this thread a complete correct method, method about te | New Users to Excel | |||
best method | Excel Discussion (Misc queries) | |||
SetFocus on a different sheet in VBA | Excel Discussion (Misc queries) | |||
TextBox.SetFocus | Excel Programming |