Reset a UserForm 
Author Message
 Reset a UserForm

G'day All,
In a UserForm, if the User elects to Reset All (an option to clear all)
the cursor reamains in the Control last used. I want to return the
cursor to the first control. Apart from using SendKeys until it reaches
the first control, I can't see any way of achieving this, does anyone
have a better idea?Using XL97SR2 in Win95b
Thanks in anticipation.
Lins

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Wed, 18 Jun 1902 08:00:00 GMT  
 Reset a UserForm

Lins,

Use the SetFocus method on the control you want to move the cursor to:

Private Sub btnResetAll_Click()
    Me.tbxTextBox1.SetFocus
End Sub

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC


Quote:
> G'day All,
> In a UserForm, if the User elects to Reset All (an option to clear all)
> the cursor reamains in the Control last used. I want to return the
> cursor to the first control. Apart from using SendKeys until it reaches
> the first control, I can't see any way of achieving this, does anyone
> have a better idea?Using XL97SR2 in Win95b
> Thanks in anticipation.
> Lins

> Sent via Deja.com http://www.deja.com/
> Before you buy.



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Variable(s) Reset by Showing 2nd UserForm on top 1st UserForm

2. Resetting variables in userform

3. Resetting objects in userform

4. Resetting userform controls en mass

5. recalling a userform and resetting document

6. Tasks: Resetting StartDate resets DueDate

7. UserForm To UserForm

8. Displaying Another UserForm when click on CheckBox in UserForm

9. Passing a Variable from one Userform to another Userform

10. Userform Properties not available in MSForms.Userform


 
Powered by phpBB® Forum Software © phpBB Group