S
slarbie
I have a validation routine built for the exit event of my combobox, and it
all works fine. But I'd like the cursor to be blinking in the box again when
all's said and done so the user doesn't have to click back on the control. I
thought the SetFocus, SelStart and SelLength would do that, but no such luck
with the way I have it written. I've also tried various combinations of 1's
and 0's for the SelStart and SelLength settings. What am I missing?
Private Sub cboRPI_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If cboRPI <> "" And cboChassis = "blahblah" Then
n = Val(cboRPI)
If n Mod 50 <> 0 Or n < 50 Or n > 7500 Then
Cancel = True
MsgBox "Must be in $50 increments between $50 and $7,500"
cboRPI = ""
cboRPI.SelLength = 0
cboRPI.SelStart = 0
cboRPI.SetFocus
End If
End If
End Sub
all works fine. But I'd like the cursor to be blinking in the box again when
all's said and done so the user doesn't have to click back on the control. I
thought the SetFocus, SelStart and SelLength would do that, but no such luck
with the way I have it written. I've also tried various combinations of 1's
and 0's for the SelStart and SelLength settings. What am I missing?
Private Sub cboRPI_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If cboRPI <> "" And cboChassis = "blahblah" Then
n = Val(cboRPI)
If n Mod 50 <> 0 Or n < 50 Or n > 7500 Then
Cancel = True
MsgBox "Must be in $50 increments between $50 and $7,500"
cboRPI = ""
cboRPI.SelLength = 0
cboRPI.SelStart = 0
cboRPI.SetFocus
End If
End If
End Sub