Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a form with a MultiPage control. When focus is changed to another
page, I want to make sure that data on the existing page has been updated by the user. If they want to save their data, I want to keep them on the current page so they can click the Update button. I implemented this behavior by using the MultiPage.Click event. This event receives control AFTER the new page receives focus. In the event procedure if I detect that data has not been updated, I want to display the prior page. I do this by setting MultiPage.value to the prior page index. What is happening is when I set the Value property, that the correct Tab is receiving focus, but the contents of the page do not change to that page's controls. Very bizarre. Any suggestions? inTHANKSadvance |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Jim,
I've been driven to distraction by this too. I couldn't find anything on MS. However (see below links) it appears to be a bug in XL2003. http://www.dicks-blog.com/archives/2...trols-on-2003/ http://www.excelforum.com/archive/in.../t-220362.html Yup. It sucks. Maybe Tab Strips can suit your purpose - I don't know about you though but I have a huge amount of code behind mine and just hadn't put in the error trapping when changing pages bit until the end. That said, I haven't tried the workaround mentioned in the first link yet but anything using OnTime seems a little sketchy. HTH, Gareth Jim Zeeb wrote: I have a form with a MultiPage control. When focus is changed to another page, I want to make sure that data on the existing page has been updated by the user. If they want to save their data, I want to keep them on the current page so they can click the Update button. I implemented this behavior by using the MultiPage.Click event. This event receives control AFTER the new page receives focus. In the event procedure if I detect that data has not been updated, I want to display the prior page. I do this by setting MultiPage.value to the prior page index. What is happening is when I set the Value property, that the correct Tab is receiving focus, but the contents of the page do not change to that page's controls. Very bizarre. Any suggestions? inTHANKSadvance |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Maybe you can just keep those other pages disabled until all the information is
entered. You could have each control call a separate subroutine to make sure there's something in everything you want. Difficult to describe since I don't know the controls you're using... But I created a small userform with two pages. On the first page, I put 2 textboxes and 2 optionbuttons. I had this code behind the form: Option Explicit Private Sub OptionButton1_Click() Call CheckControls End Sub Private Sub OptionButton2_Click() Call CheckControls End Sub Private Sub TextBox1_Change() Call CheckControls End Sub Private Sub TextBox2_Change() Call CheckControls End Sub Private Sub CheckControls() Dim okToContinue As Boolean okToContinue = True If Me.TextBox1.Value = "" Then okToContinue = False ElseIf Me.TextBox2.Value = "" Then okToContinue = False ElseIf (Me.OptionButton1.Value = False _ And Me.OptionButton2.Value = False) Then okToContinue = False End If Me.MultiPage1.Pages(1).Enabled = okToContinue End Sub Private Sub UserForm_Initialize() Me.MultiPage1.Pages(1).Enabled = False End Sub ======= An alternative would be to put all the validation into a button (kind of a Next button) that would do the checking. If everthing was ok, it would either enable the next page (or even make it visible!). Kind of like one of those wizards you see (data|text to columns) Jim Zeeb wrote: I have a form with a MultiPage control. When focus is changed to another page, I want to make sure that data on the existing page has been updated by the user. If they want to save their data, I want to keep them on the current page so they can click the Update button. I implemented this behavior by using the MultiPage.Click event. This event receives control AFTER the new page receives focus. In the event procedure if I detect that data has not been updated, I want to display the prior page. I do this by setting MultiPage.value to the prior page index. What is happening is when I set the Value property, that the correct Tab is receiving focus, but the contents of the page do not change to that page's controls. Very bizarre. Any suggestions? inTHANKSadvance -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
MultiPage Component Property | Excel Programming | |||
MultiPage - How to set MutiRow property? | Excel Programming | |||
Check for any data changes in a form with multipage object | Excel Programming | |||
Displaying Cell Data on a Form | Excel Programming | |||
Displaying different pages in MultiPage | Excel Programming |