LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default SetFocus in a custom dialog

Hi

I have a logon dialog created with two fields (username & password)
and two buttons (login and cancel).

I'm checking with an event if the fields are empty and enable the
login-button only then.

Private Sub txtPwd_AfterUpdate()
If Me.txtUsr.Value < "" And Me.txtPwd.Value < "" Then
Me.cmdLogin.Enabled = True
Me.cmdLogin.SetFocus
Else
Me.cmdLogin.Enabled = False
Me.txtPwd.SetFocus
End If
End Sub

If both fields (Username and Password) are different than "" then I
enable the login-button. And I also want to set the focus on this
login button. But although I do this using the Me.cmdLogin.SetFocus
the focus is set to the next item (the cancel-button). I've tried to
set it on the password-field or any other object, but it just isn't
setting the focus on the login-button.

What am I doing wrong?

Any hint appreciated.

Matthias
 
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
Display a Custom Dialog Box BHatMJ Excel Discussion (Misc queries) 3 May 21st 08 09:24 AM
Help with Custom Dialog Box nospaminlich Excel Programming 3 January 26th 06 08:52 PM
Custom Dialog Boxes iambalrog[_3_] Excel Programming 1 December 16th 05 10:04 AM
Custom View Dialog Box GLT Excel Discussion (Misc queries) 0 November 13th 05 03:20 PM
Custom made dialog box Deeds[_2_] Excel Programming 1 May 27th 04 07:58 PM


All times are GMT +1. The time now is 06:14 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"