Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Please post this thread a correct full method, method about Nast Runsome New Users to Excel 8 February 25th 08 03:29 PM
Please post this thread a complete correct method, method about te Nast Runsome New Users to Excel 0 February 23rd 08 09:42 PM
best method Tim Excel Discussion (Misc queries) 1 October 17th 05 10:05 AM
SetFocus on a different sheet in VBA AaronC Excel Discussion (Misc queries) 1 June 9th 05 11:18 PM
TextBox.SetFocus steve Excel Programming 4 July 16th 03 07:40 PM


All times are GMT +1. The time now is 03:30 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"