Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have created a user form, and I'm at the stage where I'm programming the
data entry validation. I'm getting the message box to display when the user hasn't enter what was expected, but then I can't get the code to return the focus to the form itself to allow the user to correct the data entry. Any suggestions? Thanks! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Lets see your code then maybe we can help
"Capt. Bangs" wrote: I have created a user form, and I'm at the stage where I'm programming the data entry validation. I'm getting the message box to display when the user hasn't enter what was expected, but then I can't get the code to return the focus to the form itself to allow the user to correct the data entry. Any suggestions? Thanks! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This probably isn't very elegant: I'm a newbie. But I appreciate your offer
of help. GoodData = False 'ensures that the loop starts Do Until GoodData If txtUserEmail.Value Like "*_*" Then 'checks to make sure that the user's name is in the form "firstname_lastname" GoodData = True Else If txtUserEmail.Value Like "* *" Then 'if the e-mail address is missing the underscore txtUserEmail.Value = LTrim(txtUserEmail.Value) txtUserEmail.Value = Replace(txtUserEmail.Value, " ", "_") 'the program replaces a space with an underscore GoodData = True Else If txtUserEmail.Value = "" Then 'if the user has not entered a name in the text box Dim Answer As VbMsgBoxResult Answer = MsgBox("You have not entered your e-mail address.", vbOKCancel) If Answer = 2 Then Exit Function End If Else If Answer = 1 Then txtUserEmail.SetFocus End If End If End If End If Loop "Mike" wrote: Lets see your code then maybe we can help "Capt. Bangs" wrote: I have created a user form, and I'm at the stage where I'm programming the data entry validation. I'm getting the message box to display when the user hasn't enter what was expected, but then I can't get the code to return the focus to the form itself to allow the user to correct the data entry. Any suggestions? Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Setting focus on User Form Listbox | Excel Programming | |||
set focus on user form | Excel Programming | |||
User Form focus | Excel Programming | |||
Modeless User Form and Worksheet Focus | Excel Programming | |||
Text Box on User Form Set Focus Issue | Excel Programming |