Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
SetFocus question
Can someone tell me why this code does not return the focus to TextBox7
If Len(PhoneNum) = 1 Then 'Checks for a correct amount of numbers MsgBox "Please enter a correct Phone Number" TextBox7.SetFocus End If |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
SetFocus question
What does happen? Where is this code located at? Did you really mean =1?
-- Rick (MVP - Excel) "Patrick C. Simonds" wrote in message ... Can someone tell me why this code does not return the focus to TextBox7 If Len(PhoneNum) = 1 Then 'Checks for a correct amount of numbers MsgBox "Please enter a correct Phone Number" TextBox7.SetFocus End If |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
SetFocus question
Hi,
Your code must be on the userform code sheet. Here is a typical block of code to handle an incorrect or missing entry: IF Len(me.txtPhone) <7 then Beep MsgBox "That is not a legal phone number." me.txtPhone="" me.txtPhone.SetFocut Exit Sub End IF This would be attached to the OK button of your userform in many cases. -- Thanks, Shane Devenshire "Patrick C. Simonds" wrote: Can someone tell me why this code does not return the focus to TextBox7 If Len(PhoneNum) = 1 Then 'Checks for a correct amount of numbers MsgBox "Please enter a correct Phone Number" TextBox7.SetFocus End If |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
userform setfocus question | Excel Programming | |||
SetFocus? | Excel Programming | |||
setfocus | Excel Programming | |||
SetFocus Question | Excel Programming | |||
UserForm1.Textbox1.SetFocus Question | Excel Programming |