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: 23
Default Position to UserForm TextBox from OK_Click MsgBox

in a UserForm with 2 textboxes (UsrID & Psw) & 2 command buttons (OK &
Cancel), my sub OK_Click is as follows:

Private Sub OK_Click()
If Me.UsrID = Empty Then
MsgBox ("You Must Enter A User Name")
Else
If Me.Psw = Empty Then
MsgBox ("You Must Enter A Password")
Else
Module1.UsrID = Me.UsrID.Value
Module1.Psw = Me.Psw.Value
Unload Me
End If
End If
End Sub

If either If condition is true, how can I position back to the offending
textbox for re-entry?
Also, for Cancel, I would like to abort the calling module after verifying
the user's intention of cancelling. Any ideas on this?
Thanks.
--
Will
 
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
Position of MsgBox Otto Moehrbach[_2_] Excel Programming 7 May 17th 08 05:21 PM
MsgBox Position Dewald Excel Programming 2 October 14th 05 01:11 PM
MsgBox position RJH Excel Programming 2 August 19th 04 08:49 AM
MsgBox position Jeff[_33_] Excel Programming 2 June 14th 04 10:14 PM
Position of MsgBox Konrad[_2_] Excel Programming 0 August 7th 03 05:27 PM


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