Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting Focus not working as expected
I am verifiying data by VBA. When it traps an error, I am trying to go back
to the control that caused the error. It's not working for me. Code: Select Case intLoan_Spread 'as entered in user form Case Is intMaxLoan_Spread 'max is 1000 msgstring3 = "Maximum loan spread is " & intMaxLoan_Spread & ". " & msgstring3 MsgBox (msgstring3) Me.TXBBasisPoints = intMaxLoan_Spread Cancel = True Me.TXBBasisPoints.SetFocus Case Is < intMinLoan_Spread 'min is 100 msgstring3 = "Minimum loan spread is " & intMinLoan_Spread & ". " & msgstring3 MsgBox (msgstring3) Me.TXBBasisPoints = intMinLoan_Spread Cancel = True Me.TXBBasisPoints.SetFocus Case Else 'passes validation |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Workdays not working as expected | Excel Discussion (Misc queries) | |||
Iserror not working as expected | Excel Worksheet Functions | |||
Setting the focus | New Users to Excel | |||
Lookup Not working as expected | New Users to Excel | |||
setting the focus using VB | Excel Programming |