PC Review


Reply
Thread Tools Rate Thread

activating a page of a multipage control

 
 
Arne
Guest
Posts: n/a
 
      12th Dec 2007
Hello,

I want to chek user input on a page (index 1) of a multipage control as
soon as another page is selected. I have something like this:

Private Sub mpProcessData_Change()

If lngLastPage = 1 Then
If Not PageOK Then
Application.EnableEvents = False
mpProcessData.Value = 1
Application.EnableEvents = True
End If
End If
lngLastPage = mpProcessData.Value

End Sub

Apart from the fact that it does not work (only the tab is selected not the
page, regardless whether EnableEvent is enabled or not), I do not like it,
because I am forced to declare the global variable lngLastPage. Is there a
better way to do this?

TIA,

Arne
 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      12th Dec 2007
The tab is the page. Why does lngLastPage have to be global? Page indexes
start at 0 BTW.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Arne" <(E-Mail Removed)> wrote in message
news:5A98080D-C4D7-4A22-8A53-(E-Mail Removed)...
> Hello,
>
> I want to chek user input on a page (index 1) of a multipage control as
> soon as another page is selected. I have something like this:
>
> Private Sub mpProcessData_Change()
>
> If lngLastPage = 1 Then
> If Not PageOK Then
> Application.EnableEvents = False
> mpProcessData.Value = 1
> Application.EnableEvents = True
> End If
> End If
> lngLastPage = mpProcessData.Value
>
> End Sub
>
> Apart from the fact that it does not work (only the tab is selected not
> the
> page, regardless whether EnableEvent is enabled or not), I do not like it,
> because I am forced to declare the global variable lngLastPage. Is there a
> better way to do this?
>
> TIA,
>
> Arne



 
Reply With Quote
 
Arne
Guest
Posts: n/a
 
      12th Dec 2007


"Bob Phillips" wrote:

> The tab is the page. OK, fine, but how do I get the page that corresponds to the tab displayed? The tab (#1) is activated alright, but not the page 'attached' to it. So, the problem remains


Why does lngLastPage have to be global? Because it would go out of scope if
it were defined in the Event sub? The scope of that variable therefore has to
be the module of the form on which the multipage is displayed, I think(?)

Page indexes
> start at 0 BTW. I know, 1 was an arbitrary number.
>
> --
> ---
> HTH
>
> Bob
>
>
> (there's no email, no snail mail, but somewhere should be gmail in my addy)
>
>
>
> "Arne" <(E-Mail Removed)> wrote in message
> news:5A98080D-C4D7-4A22-8A53-(E-Mail Removed)...
> > Hello,
> >
> > I want to chek user input on a page (index 1) of a multipage control as
> > soon as another page is selected. I have something like this:
> >
> > Private Sub mpProcessData_Change()
> >
> > If lngLastPage = 1 Then
> > If Not PageOK Then
> > Application.EnableEvents = False
> > mpProcessData.Value = 1
> > Application.EnableEvents = True
> > End If
> > End If
> > lngLastPage = mpProcessData.Value
> >
> > End Sub
> >
> > Apart from the fact that it does not work (only the tab is selected not
> > the
> > page, regardless whether EnableEvent is enabled or not), I do not like it,
> > because I am forced to declare the global variable lngLastPage. Is there a
> > better way to do this?
> >
> > TIA,
> >
> > Arne

>
>
>

 
Reply With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      13th Dec 2007
>> The tab (#1) is activated alright, but not the page 'attached' to it. So,
>> the problem remains


I have no idea what you mean by that.

Declare it as Static and it won't.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Arne" <(E-Mail Removed)> wrote in message
news:9CB574A5-DBFE-4AF2-9272-(E-Mail Removed)...
>
>
> "Bob Phillips" wrote:
>
>> The tab is the page. OK, fine, but how do I get the page that corresponds
>> to the tab displayed? The tab (#1) is activated alright, but not the page
>> 'attached' to it. So, the problem remains

>
> Why does lngLastPage have to be global? Because it would go out of scope
> if
> it were defined in the Event sub? The scope of that variable therefore has
> to
> be the module of the form on which the multipage is displayed, I think(?)
>
> Page indexes
>> start at 0 BTW. I know, 1 was an arbitrary number.
>>
>> --
>> ---
>> HTH
>>
>> Bob
>>
>>
>> (there's no email, no snail mail, but somewhere should be gmail in my
>> addy)
>>
>>
>>
>> "Arne" <(E-Mail Removed)> wrote in message
>> news:5A98080D-C4D7-4A22-8A53-(E-Mail Removed)...
>> > Hello,
>> >
>> > I want to chek user input on a page (index 1) of a multipage control
>> > as
>> > soon as another page is selected. I have something like this:
>> >
>> > Private Sub mpProcessData_Change()
>> >
>> > If lngLastPage = 1 Then
>> > If Not PageOK Then
>> > Application.EnableEvents = False
>> > mpProcessData.Value = 1
>> > Application.EnableEvents = True
>> > End If
>> > End If
>> > lngLastPage = mpProcessData.Value
>> >
>> > End Sub
>> >
>> > Apart from the fact that it does not work (only the tab is selected not
>> > the
>> > page, regardless whether EnableEvent is enabled or not), I do not like
>> > it,
>> > because I am forced to declare the global variable lngLastPage. Is
>> > there a
>> > better way to do this?
>> >
>> > TIA,
>> >
>> > Arne

>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
change font color whenever click a page of multipage control tom taol Microsoft Excel Programming 0 12th Oct 2005 10:45 PM
Looking for eloquent solution: Determine of any control on a page of multipage has been altered (userform) KR Microsoft Excel Programming 0 13th Dec 2004 09:04 PM
Set Focus Problem for textbox control on multipage control =?Utf-8?B?RXhjZWxEZXZlbG9wZXJTUFI=?= Microsoft Excel Programming 1 16th Jul 2004 08:54 PM
hide a page on a multipage control Spencer Hutton Microsoft Excel Programming 1 22nd Apr 2004 02:07 PM
WEB FORM CONTROLS ON MULTIPAGE CONTROL MOVE WHEN PAGE LOADS rb Microsoft ASP .NET 0 25th Nov 2003 05:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:44 PM.