Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default MultiPage Form data not displaying when Value property changed

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default MultiPage Form data not displaying when Value property changed

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default MultiPage Form data not displaying when Value property changed

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
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
MultiPage Component Property RJM[_2_] Excel Programming 2 July 3rd 05 01:23 AM
MultiPage - How to set MutiRow property? TEB2 Excel Programming 6 May 10th 05 08:06 PM
Check for any data changes in a form with multipage object Bert Neuenschwander Excel Programming 2 September 24th 04 06:31 AM
Displaying Cell Data on a Form Ebgar[_3_] Excel Programming 2 July 20th 04 06:10 PM
Displaying different pages in MultiPage Joepy Excel Programming 0 August 11th 03 01:03 PM


All times are GMT +1. The time now is 12:14 AM.

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

About Us

"It's about Microsoft Excel"