Thread: Stay in TextBox
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
keepITcool keepITcool is offline
external usenet poster
 
Posts: 2,253
Default SV: Stay in TextBox

the exit events is not triggered by code.

alternative:
Option Explicit

Private Sub TextBox1_Change()
If Me.ActiveControl Is Me.TextBox1 Then Exit Sub
Me.Label1 = Me.TextBox1
End Sub

Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Me.Label1 = Me.TextBox1
End Sub

hth

keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


?B?YWt5aG5l?= wrote:

It works great if I tab out of the TextBox, or if I click another
TextBox.

But if I click a Button on the Form, no error happens.