By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,398 Members | 1,372 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,398 IT Pros & Developers. It's quick & easy.

Which page am I on?

P: n/a
Hello,

I have a form with two pages - that is, the height of the form is
about two screen heights and it has a PageBreak half way down.

I move between the pages with:

Me.GoToPage 1
and
Me.GoToPage 2

The user will select the page from a button on a custom CommandBar

How can I get VBA to tell me which page is currently being displayed?
I cannot find a property like "CurrentPage". All the properties to do
with pages seem to relate to pages on Tab Controls. If there was a
"CurrentPage" property, I could use code like:

If Me.CurrentPage = 1 Then
Do something
Else
Do something different
End If

Is there a way to achieve the result I want?
Nov 13 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
Adrian wrote:
Hello,

I have a form with two pages - that is, the height of the form is
about two screen heights and it has a PageBreak half way down.

I move between the pages with:

Me.GoToPage 1
and
Me.GoToPage 2

The user will select the page from a button on a custom CommandBar

How can I get VBA to tell me which page is currently being displayed?
I cannot find a property like "CurrentPage". All the properties to do
with pages seem to relate to pages on Tab Controls. If there was a
"CurrentPage" property, I could use code like:

If Me.CurrentPage = 1 Then
Do something
Else
Do something different
End If

Is there a way to achieve the result I want?


If Screen.ActiveControl.Top < Me.PageBreakControl.Top Then
Page=1
else
Page=2
end if

--
This sig left intentionally blank
Nov 13 '05 #2

P: n/a

"Trevor Best" <no****@besty.org.uk> wrote in message
news:41**********************@news.zen.co.uk...
Adrian wrote:
Hello,

I have a form with two pages - that is, the height of the form is
about two screen heights and it has a PageBreak half way down.

I move between the pages with:
Me.GoToPage 1
and
Me.GoToPage 2

The user will select the page from a button on a custom CommandBar

How can I get VBA to tell me which page is currently being displayed? I
cannot find a property like "CurrentPage". All the properties to do
with pages seem to relate to pages on Tab Controls. If there was a
"CurrentPage" property, I could use code like:

If Me.CurrentPage = 1 Then
Do something
Else
Do something different
End If

Is there a way to achieve the result I want?


If Screen.ActiveControl.Top < Me.PageBreakControl.Top Then
Page=1
else
Page=2
end if

--
This sig left intentionally blank


That should be, "This sig intentionally left blank", should it not?

Nov 13 '05 #3

P: n/a
>>This sig left intentionally blank

That should be, "This sig intentionally left blank", should it not?


As I see it mostly:

This page left blank unintentionally

--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
I prefer human mail above automated so in my address
replace the queue with a tea
Nov 13 '05 #4

P: n/a
Trevor,

'If Screen.ActiveControl.Top < Me.PageBreakControl.Top Then
' Page = 1
'Else
' Page = 2
'End If

Many thanks for this ingenious response.

It was not my intention to start a thread about the position of adverbs.
Adrian
Nov 13 '05 #5

P: n/a
Daven Thrice wrote:
"Trevor Best" <no****@besty.org.uk> wrote in message

--
This sig left intentionally blank

That should be, "This sig intentionally left blank", should it not?


Nah!

--
This blank sig left intentionally
Nov 13 '05 #6

P: n/a
Adrian wrote:
Trevor,

'If Screen.ActiveControl.Top < Me.PageBreakControl.Top Then
' Page = 1
'Else
' Page = 2
'End If

Many thanks for this ingenious response.

It was not my intention to start a thread about the position of adverbs.


Don't sweat it :-)

--
This intentionally left blank sig
Nov 13 '05 #7

P: n/a

"Trevor Best" <no****@besty.org.uk> wrote in message
news:41**********************@news.zen.co.uk...
Adrian wrote:
Trevor,

'If Screen.ActiveControl.Top < Me.PageBreakControl.Top Then
' Page = 1
'Else
' Page = 2
'End If

Many thanks for this ingenious response.

It was not my intention to start a thread about the position of adverbs.


Don't sweat it :-)


I guess we're just syntactical folks.
Nov 13 '05 #8

P: n/a
Daven Thrice wrote:
I guess we're just syntactical folks.


SELECT NP FROM B* ORDER BY adv

--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
I prefer human mail above automated so in my address
replace the queue with a tea
Nov 13 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.