Private Sub CB_Day_Exit(ByVal Cancel As MSForms.ReturnBoolean)
....
.....
If Int(CB_Day.Value) > DaysInMonth Then
CB_Day.SetFocus
CB_Day = ""
Exit Sub
Else
"Cells(17, 12) = DateSerial(Int(CB_Year.Value), m, Int(CB_Day.Value))
End If
End Sub
I have a textbox name CB_day. If CB_Month.Value = "September" the script will look up 30 as DaysInMonth. if CB_Month.Value is more the script does execute
the lines
CB_Day.SetFocus
CB_Day = ""
When the event completes however focus does pass to the next combo box. How do I prevent this. I understand that unlike Access the loss_focus is embedded in the OnExit.
What am I not understandying about the Exit event and the Setfocus command.
Thanks in Advance
....
.....
If Int(CB_Day.Value) > DaysInMonth Then
CB_Day.SetFocus
CB_Day = ""
Exit Sub
Else
"Cells(17, 12) = DateSerial(Int(CB_Year.Value), m, Int(CB_Day.Value))
End If
End Sub
I have a textbox name CB_day. If CB_Month.Value = "September" the script will look up 30 as DaysInMonth. if CB_Month.Value is more the script does execute
the lines
CB_Day.SetFocus
CB_Day = ""
When the event completes however focus does pass to the next combo box. How do I prevent this. I understand that unlike Access the loss_focus is embedded in the OnExit.
What am I not understandying about the Exit event and the Setfocus command.
Thanks in Advance