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 routine 2nd try

I use a 2 page multipage control (page 0 and Page 1) . On page 1 is
TextBox2203 which has an Exit routine (see below). My problem is that if
TextBox2203 is the active control and the user clicks on the tab to go to
page 0 of the multipage control, the exit routine for the TextBox does not
run. so is there any way to:

1. Get the exit routine to run if the user attempts to change pages without
exiting the the TextBox first.
2. If possible (but low priority) keep them on page1 if all the
OptionButtons are false.




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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default TextBox exit routine 2nd try

How about moving the guts of the _exit routine to its own module.

Then have the MultiPage1_Change event call that procedure, too.

Or maybe disabling the tabs until everything is ok. Kind of like the
Previous/Next buttons on a lot of wizards.



"Patrick C. Simonds" wrote:

I use a 2 page multipage control (page 0 and Page 1) . On page 1 is
TextBox2203 which has an Exit routine (see below). My problem is that if
TextBox2203 is the active control and the user clicks on the tab to go to
page 0 of the multipage control, the exit routine for the TextBox does not
run. so is there any way to:

1. Get the exit routine to run if the user attempts to change pages without
exiting the the TextBox first.
2. If possible (but low priority) keep them on page1 if all the
OptionButtons are false.

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


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 343
Default TextBox exit routine 2nd try

I did try coping the code into a standalone module and it worked to a point.
Problem was the that because it would move to page0. People complained that
when the spell check ran they wanted to be able to see the text that was
being checked.

How would one disable the tab to prevent them from going to page0 until the
exit routine had run? I do want them to be able to move between the pages as
long as they do not change anything in TextBox2203.



"Dave Peterson" wrote in message
...
How about moving the guts of the _exit routine to its own module.

Then have the MultiPage1_Change event call that procedure, too.

Or maybe disabling the tabs until everything is ok. Kind of like the
Previous/Next buttons on a lot of wizards.



"Patrick C. Simonds" wrote:

I use a 2 page multipage control (page 0 and Page 1) . On page 1 is
TextBox2203 which has an Exit routine (see below). My problem is that if
TextBox2203 is the active control and the user clicks on the tab to go to
page 0 of the multipage control, the exit routine for the TextBox does
not
run. so is there any way to:

1. Get the exit routine to run if the user attempts to change pages
without
exiting the the TextBox first.
2. If possible (but low priority) keep them on page1 if all the
OptionButtons are false.

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


--

Dave Peterson


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default TextBox exit routine 2nd try

Here's a thread that you may be able to steal some ideas from:

http://groups.google.co.uk/group/mic...t:multipage 1

or
http://tinyurl.com/ldg45z


"Patrick C. Simonds" wrote:

I did try coping the code into a standalone module and it worked to a point.
Problem was the that because it would move to page0. People complained that
when the spell check ran they wanted to be able to see the text that was
being checked.

How would one disable the tab to prevent them from going to page0 until the
exit routine had run? I do want them to be able to move between the pages as
long as they do not change anything in TextBox2203.

"Dave Peterson" wrote in message
...
How about moving the guts of the _exit routine to its own module.

Then have the MultiPage1_Change event call that procedure, too.

Or maybe disabling the tabs until everything is ok. Kind of like the
Previous/Next buttons on a lot of wizards.



"Patrick C. Simonds" wrote:

I use a 2 page multipage control (page 0 and Page 1) . On page 1 is
TextBox2203 which has an Exit routine (see below). My problem is that if
TextBox2203 is the active control and the user clicks on the tab to go to
page 0 of the multipage control, the exit routine for the TextBox does
not
run. so is there any way to:

1. Get the exit routine to run if the user attempts to change pages
without
exiting the the TextBox first.
2. If possible (but low priority) keep them on page1 if all the
OptionButtons are false.

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


--

Dave Peterson


--

Dave Peterson
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
TextBox exit problem Patrick C. Simonds Excel Programming 4 August 3rd 09 01:03 AM
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
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 06:41 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"