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: 53
Default combobox setfocus

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


 
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
setfocus ranswrt Excel Programming 2 July 22nd 08 02:56 AM
SetFocus? plh Excel Programming 1 May 1st 06 03:01 AM
SetFocus from ComboBox to Calendar gives Run-time error Paulbram Excel Programming 1 April 27th 05 07:50 AM
setfocus Dean Reardon Excel Programming 2 December 15th 04 12:18 PM
How Do I Get SetFocus On A ComboBox In A Frame? Minitman[_4_] Excel Programming 5 November 6th 04 05:23 AM


All times are GMT +1. The time now is 12:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"