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: 1
Default BeforeUpdate Event triggers twice

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
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
beforeUpdate event of Web Query johnbest[_3_] Excel Programming 2 January 25th 06 01:37 PM
How can I expose the TextBox BeforeUpdate event to my user class? bereid Excel Discussion (Misc queries) 0 November 30th 05 05:00 PM
Event Triggers MVM Excel Programming 2 August 31st 05 03:29 PM
ComboBox control behavior changes when BeforeUpdate event hand Rick Lowe Excel Programming 0 August 25th 04 10:13 PM
BeforeUpdate event for Combo box Brad Excel Programming 2 May 7th 04 06:22 PM


All times are GMT +1. The time now is 03:06 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"