Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am getting a curious result when coding a ms excel 2003 form.
-------------------------------------------------------------------------------------------------------------------------------------- Private Sub BookNumberTextBox_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean) 'MsgBox "Please ensure that the Docket Number being input is six digits long.", _ vbOKOnly, "Correct Data Input" If Len(Me.BookNumberTextBox) < 6 Or Len(Me.BookNumberTextBox) = 0 Then Me.lblError = "Please ensure that the Docket Number being input is six digits long." Cancel = True End If End Sub -------------------------------------------------------------------------------------------------------------------------------------- The code above is being triggered twice when a user tries to tab out of the control. Basically, if the if statement is true, i dont want the user to be able to leave the textbox. This is taken care of... When i had the error message as a msgbox, it would be triggered twice... i fixed this by having an error label... but it is messing with my tabindex... for some reason when the before update event passes... it is skipping the next box in the tabindex and going to the one after... i am assuming this has something to do with the two triggers. Has anyone seen this problem before?? thanks Mark |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
beforeUpdate event of Web Query | Excel Programming | |||
How can I expose the TextBox BeforeUpdate event to my user class? | Excel Discussion (Misc queries) | |||
Event Triggers | Excel Programming | |||
ComboBox control behavior changes when BeforeUpdate event hand | Excel Programming | |||
BeforeUpdate event for Combo box | Excel Programming |