Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
TextBox exit problem | Excel Programming | |||
Pressing TAB doesn't exit TextBox | Excel Programming | |||
Delete textbox after exit | Excel Programming | |||
Urgent - how to run textbox exit sub? | Excel Programming | |||
How To Get An Event To Run When I Exit A TextBox | Excel Programming |