![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Posts: 64
|
I have a form that includes a multipage. Each page of the multipage has several text boxes. Each text box had an Exit event subroutine that checks the entry in the text box. If it is not an appropriate entry, then it disallows exiting the text box. This works fine on a page, but the exit event is not processed when switching from one page to another. Any suggestions?
Is there a way to force a return ot tab so the focus will try to exit the box? (Ivan, the multipage change event causes some problems, the click or mouse down is less confusing. However, if I have it go back to the previous page and try focusing on another textbox (so that it will exit the previous textbox, I get a program error if there is an error in the textbox enty.) |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Bogota, Colombia
Posts: 11,927
|
Well... if you're looking for Textboxes that are empty, you could use something like
TextBox1.Parent.Name to get the Name of the Page that contains the TextBox, activate it, and then, set focus on that textbox. |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
Maybe duplicate your validation code in the Private Sub MultiPage1_Exit event.
If you click on a tab, use the index number in a select case or if...then statement to validate the appropriate text boxes. If the conditions are not met, you can cancel the exit from the page and setfocus to the textbox containing the error. Tom |
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Bogota, Colombia
Posts: 11,927
|
Hey TsTom, isn't the change event for the "whole" MultiPage ?
I mean, if i put something like Private Sub MultiPage1_Exit(ByVal Cancel As MSForms.ReturnBoolean) MsgBox MultiPage1.Value End Sub I only get the number when I change control, not when I change Page. |
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
Your right Juan.
I should have tried it out before I posted it. Tom |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|