Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have several textboxes to collect bank account details. I'm running the
following code on exit: Private Sub txtBankNum1_Exit(ByVal Cancel As MSForms.ReturnBoolean) If Len(txtBankNum1) < 2 Then MsgBox "Please enter the two digit bank code." txtBankNum1.SetFocus End If End Sub Problem is that this doesn't reset the cursor to txtBankNum1, it just moves on to the next box as normal. Any ideas? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Have you tried
Private Sub txtBankNum1_Exit(ByVal Cancel As MSForms.ReturnBoolean) If Len(txtBankNum1) < 2 Then MsgBox "Please enter the two digit bank code." Cancel = True End If End Sub hth Geoff "BOBODD" wrote: I have several textboxes to collect bank account details. I'm running the following code on exit: Private Sub txtBankNum1_Exit(ByVal Cancel As MSForms.ReturnBoolean) If Len(txtBankNum1) < 2 Then MsgBox "Please enter the two digit bank code." txtBankNum1.SetFocus End If End Sub Problem is that this doesn't reset the cursor to txtBankNum1, it just moves on to the next box as normal. Any ideas? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Cheers, perfect.
"Geoff" wrote: Have you tried Private Sub txtBankNum1_Exit(ByVal Cancel As MSForms.ReturnBoolean) If Len(txtBankNum1) < 2 Then MsgBox "Please enter the two digit bank code." Cancel = True End If End Sub hth Geoff "BOBODD" wrote: I have several textboxes to collect bank account details. I'm running the following code on exit: Private Sub txtBankNum1_Exit(ByVal Cancel As MSForms.ReturnBoolean) If Len(txtBankNum1) < 2 Then MsgBox "Please enter the two digit bank code." txtBankNum1.SetFocus End If End Sub Problem is that this doesn't reset the cursor to txtBankNum1, it just moves on to the next box as normal. Any ideas? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
userform setfocus question | Excel Programming | |||
Userform SetFocus with Exit and Cancel | Excel Programming | |||
Userform setfocus problem | Excel Programming | |||
SetFocus to first textbox on userform upon Userform1.Show | Excel Programming | |||
SetFocus problem | Excel Programming |