Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 343
Default TextBox exit problem

On my UserForm I use a Multipage control. My problem is that I have
TextBox2201 on the second page, and it has a routine I want to run upon exit
of the TextBox. All works well if the user clicks on something else on page
2, but if the click on the tab to go back to page 1 the TextBox exit
routine does not run.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default TextBox exit problem

You need a change event

Private Sub MultiPage1_Change()

End Sub

"Patrick C. Simonds" wrote:

On my UserForm I use a Multipage control. My problem is that I have
TextBox2201 on the second page, and it has a routine I want to run upon exit
of the TextBox. All works well if the user clicks on something else on page
2, but if the click on the tab to go back to page 1 the TextBox exit
routine does not run.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 343
Default TextBox exit problem

I thought of that as well and tried the code below thinking it would trigger
the Textbox exit routine.

Private Sub MultiPage1_Change()
TextBox201.SelectionMargin = True
End Sub

"Joel" wrote in message
...
You need a change event

Private Sub MultiPage1_Change()

End Sub

"Patrick C. Simonds" wrote:

On my UserForm I use a Multipage control. My problem is that I have
TextBox2201 on the second page, and it has a routine I want to run upon
exit
of the TextBox. All works well if the user clicks on something else on
page
2, but if the click on the tab to go back to page 1 the TextBox exit
routine does not run.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default TextBox exit problem

Without being able to see your code (to know what that code is actually
doing), it is a little difficult to give you a specific response; however,
the general way to do what you seem to be asking for is to put the code you
want run from the two event procedures in a subroutine and then call the
subroutine from both of those locations (rather than trying to get one event
procedure to trigger a different event). If there are procedure specific
code that must be run in conjunction with a core body of code, that would
usually be handled by providing an argument so the calling code can tell the
subroutine's code who called it.

--
Rick (MVP - Excel)


"Patrick C. Simonds" wrote in message
...
I thought of that as well and tried the code below thinking it would
trigger the Textbox exit routine.

Private Sub MultiPage1_Change()
TextBox201.SelectionMargin = True
End Sub

"Joel" wrote in message
...
You need a change event

Private Sub MultiPage1_Change()

End Sub

"Patrick C. Simonds" wrote:

On my UserForm I use a Multipage control. My problem is that I have
TextBox2201 on the second page, and it has a routine I want to run upon
exit
of the TextBox. All works well if the user clicks on something else on
page
2, but if the click on the tab to go back to page 1 the TextBox exit
routine does not run.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 343
Default TextBox exit problem

This is the TextBox Exit code and it woks as long as the user clicks on
anything on the current MultiPage control. But if they click on the tab to
show the other page (of the MultiPage control) the TextBox Exit code does
not run.



Private Sub TextBox2203_Exit(ByVal Cancel As MSForms.ReturnBoolean)


Application.SpellingOptions.IgnoreCaps = False
Sheets("Sheet2").Unprotect

Sheets("Sheet2").Range("a1").Value = TextBox2203.Text
Application.EnableEvents = False
Sheets("Sheet2").Range("a1").CheckSpelling
Application.EnableEvents = True
TextBox2203.Text = ""
TextBox2203.Text = Sheets("Sheet2").Range("a1").Value
Sheets("Sheet2").Range("a1").Value = ""

If TextBox2203.Value < rng1(1, 7) Then

OptionButton2201.Value = False
OptionButton2202.Value = False
OptionButton2203.Value = False
OptionButton2204.Value = False
OptionButton2205.Value = False
OptionButton2206.Value = False

End If

End Sub






"Rick Rothstein" wrote in message
...
Without being able to see your code (to know what that code is actually
doing), it is a little difficult to give you a specific response; however,
the general way to do what you seem to be asking for is to put the code
you want run from the two event procedures in a subroutine and then call
the subroutine from both of those locations (rather than trying to get one
event procedure to trigger a different event). If there are procedure
specific code that must be run in conjunction with a core body of code,
that would usually be handled by providing an argument so the calling code
can tell the subroutine's code who called it.

--
Rick (MVP - Excel)


"Patrick C. Simonds" wrote in message
...
I thought of that as well and tried the code below thinking it would
trigger the Textbox exit routine.

Private Sub MultiPage1_Change()
TextBox201.SelectionMargin = True
End Sub

"Joel" wrote in message
...
You need a change event

Private Sub MultiPage1_Change()

End Sub

"Patrick C. Simonds" wrote:

On my UserForm I use a Multipage control. My problem is that I have
TextBox2201 on the second page, and it has a routine I want to run upon
exit
of the TextBox. All works well if the user clicks on something else on
page
2, but if the click on the tab to go back to page 1 the TextBox exit
routine does not run.


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
Pressing TAB doesn't exit TextBox Deskman Excel Programming 5 August 23rd 07 01:18 PM
Delete textbox after exit [email protected] Excel Programming 5 February 12th 07 10:43 AM
Urgent - how to run textbox exit sub? [email protected] Excel Programming 4 October 12th 06 01:43 PM
Format textbox on exit Michael Malinsky[_2_] Excel Programming 4 March 18th 05 07:53 PM
How To Get An Event To Run When I Exit A TextBox Minitman[_4_] Excel Programming 7 October 22nd 04 11:27 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"