Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 735
Default Text Box Enter and Exit Events

Try something like......

' at top of userform code module
Dim TextBefore As String


Private Sub TextBox1_Enter()
TextBefore = Trim(TextBox1.Value)
End Sub

Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If Trim(TextBox1.Value) = TextBefore Then
MsgBox "No Change"
Else
MsgBox "Changed"
End If
End Sub

Private Sub UserForm_Initialize()
TextBefore = Trim(TextBox1.Value)
End Sub

--

Regards,
Nigel




"dunnerca" wrote in message
...
I am writing code in which I want to check the text value of a text box
upon
the exit from a text box against the value that was there upon the Enter
event. I seem to be having a problem passing this variable from the Enter
event procedure to the Exit event procedure. Anything obvious I'm
missing?
Also, is there a better way to do what I'm trying?


Reply
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
CommandButton still visible until enter and then exit design mode robs3131 Excel Programming 0 August 6th 07 07:48 PM
Events for Enter/Exit Textboxes on Userforms John Fuller Excel Programming 2 September 21st 06 03:57 PM
Button clicks and textbox Exit events Linc Excel Programming 3 December 26th 05 11:23 PM
Can't move from one cell and/or enter any data, or exit wksht... Stuck in One cell Excel Discussion (Misc queries) 2 March 28th 05 06:19 AM
On Enter and On Exit events of MSFORMS controls? Haldun Alay[_3_] Excel Programming 1 November 4th 03 01:06 PM


All times are GMT +1. The time now is 02:57 PM.

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"