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

Pages In Subform

P: n/a
Is there a way to page through a subform using PageDown and PageUp?

Thanks!

Steve
PC Datasheet
Nov 13 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
When the focus is in a continuous or datasheet style subform, Page Up/Dn
works as you would expect. I assume you mean the case where the subform is
single-form type and Page Up/Dn only moves within the current record.

I haven't tested this, but you could try setting the subform's KeyPreview to
True and using the KeyDown event to trap codes 33 and 34, then using code to
move to the next/previous record.

Something like:
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case 33
DoCmd.GoToRecord , , A_NEXT
Case 34
DoCmd.GoToRecord , , A_Previous
End Select
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''

-Ed
"PC Datasheet" <no****@nospam.spam> wrote in message
news:YO****************@newsread3.news.atl.earthli nk.net...
Is there a way to page through a subform using PageDown and PageUp?

Thanks!

Steve
PC Datasheet

Nov 13 '05 #2

P: n/a
Ed,

Thanks for responding!

I have a single subform with three pages and would like to page through it.
Your code goes through records and I want to go through pages. The GoToPage
method takes page numbers different than the GoToRecord method that goes to
Next and Previous. Any ideas on how to do the same thing with pages?

Thanks again!

Steve
PC Datasheet
"Ed Robichaud" <ed*********@wdn.com> wrote in message
news:8M***************@monger.newsread.com...
When the focus is in a continuous or datasheet style subform, Page Up/Dn
works as you would expect. I assume you mean the case where the subform
is single-form type and Page Up/Dn only moves within the current record.

I haven't tested this, but you could try setting the subform's KeyPreview
to True and using the KeyDown event to trap codes 33 and 34, then using
code to move to the next/previous record.

Something like:
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case 33
DoCmd.GoToRecord , , A_NEXT
Case 34
DoCmd.GoToRecord , , A_Previous
End Select
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''

-Ed
"PC Datasheet" <no****@nospam.spam> wrote in message
news:YO****************@newsread3.news.atl.earthli nk.net...
Is there a way to page through a subform using PageDown and PageUp?

Thanks!

Steve
PC Datasheet


Nov 13 '05 #3

P: n/a
Well since it's only three pages, you could use something similar with
either nested Case..Select or If..Then statements. Some like:
'========================
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

Select Case KeyCode
Case 33 'PgDn
If Parent!Me!Page= "Page1"
DoCmd.GoToPage "Page2"
ElseIf Parent!Me!Page= "Page2"
DoCmd.GoToPage "Page3"
'and so on.......................
End Select
End Sub
'==========================

Clumsy, but should work OK for this limited case.
-Ed
"PC Datasheet" <no****@nospam.spam> wrote in message
news:0X****************@newsread3.news.atl.earthli nk.net...
Ed,

Thanks for responding!

I have a single subform with three pages and would like to page through
it. Your code goes through records and I want to go through pages. The
GoToPage method takes page numbers different than the GoToRecord method
that goes to Next and Previous. Any ideas on how to do the same thing with
pages?

Thanks again!

Steve
PC Datasheet
"Ed Robichaud" <ed*********@wdn.com> wrote in message
news:8M***************@monger.newsread.com...
When the focus is in a continuous or datasheet style subform, Page Up/Dn
works as you would expect. I assume you mean the case where the subform
is single-form type and Page Up/Dn only moves within the current record.

I haven't tested this, but you could try setting the subform's KeyPreview
to True and using the KeyDown event to trap codes 33 and 34, then using
code to move to the next/previous record.

Something like:
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case 33
DoCmd.GoToRecord , , A_NEXT
Case 34
DoCmd.GoToRecord , , A_Previous
End Select
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''

-Ed
"PC Datasheet" <no****@nospam.spam> wrote in message
news:YO****************@newsread3.news.atl.earthli nk.net...
Is there a way to page through a subform using PageDown and PageUp?

Thanks!

Steve
PC Datasheet



Nov 13 '05 #4

P: n/a
Thanks again, Ed, for responding!

I sort of see your logic here but what are your thoughts on why you are
using 'Parent' when trying to page through the subform? Do you think this
code will keep anything from happening on the main form?

Steve
"Ed Robichaud" <ed*********@wdn.com> wrote in message
news:li***************@newshog.newsread.com...
Well since it's only three pages, you could use something similar with
either nested Case..Select or If..Then statements. Some like:
'========================
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

Select Case KeyCode
Case 33 'PgDn
If Parent!Me!Page= "Page1"
DoCmd.GoToPage "Page2"
ElseIf Parent!Me!Page= "Page2"
DoCmd.GoToPage "Page3"
'and so on.......................
End Select
End Sub
'==========================

Clumsy, but should work OK for this limited case.
-Ed
"PC Datasheet" <no****@nospam.spam> wrote in message
news:0X****************@newsread3.news.atl.earthli nk.net...
Ed,

Thanks for responding!

I have a single subform with three pages and would like to page through
it. Your code goes through records and I want to go through pages. The
GoToPage method takes page numbers different than the GoToRecord method
that goes to Next and Previous. Any ideas on how to do the same thing
with pages?

Thanks again!

Steve
PC Datasheet
"Ed Robichaud" <ed*********@wdn.com> wrote in message
news:8M***************@monger.newsread.com...
When the focus is in a continuous or datasheet style subform, Page Up/Dn
works as you would expect. I assume you mean the case where the subform
is single-form type and Page Up/Dn only moves within the current record.

I haven't tested this, but you could try setting the subform's
KeyPreview to True and using the KeyDown event to trap codes 33 and 34,
then using code to move to the next/previous record.

Something like:
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case 33
DoCmd.GoToRecord , , A_NEXT
Case 34
DoCmd.GoToRecord , , A_Previous
End Select
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''

-Ed
"PC Datasheet" <no****@nospam.spam> wrote in message
news:YO****************@newsread3.news.atl.earthli nk.net...
Is there a way to page through a subform using PageDown and PageUp?

Thanks!

Steve
PC Datasheet



Nov 13 '05 #5

P: n/a
I'm a bit of a sledge hammer style coder. If you can be sure that the focus
is on the subform, then Me! should suffice, however
Forms!MyMain!MySub.form!MyControl will ALWAYS work.

You'll have to spell out all the possibilities (6) for starting on any of
the 3 pages and moving either Up or Down. Would you want PgDn to cycle from
page 3 to page 1 or just stay on page 3? etc.
-Ed

"PC Datasheet" <no****@nospam.spam> wrote in message
news:ay*****************@newsread1.news.atl.earthl ink.net...
Thanks again, Ed, for responding!

I sort of see your logic here but what are your thoughts on why you are
using 'Parent' when trying to page through the subform? Do you think this
code will keep anything from happening on the main form?

Steve
"Ed Robichaud" <ed*********@wdn.com> wrote in message
news:li***************@newshog.newsread.com...
Well since it's only three pages, you could use something similar with
either nested Case..Select or If..Then statements. Some like:
'========================
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

Select Case KeyCode
Case 33 'PgDn
If Parent!Me!Page= "Page1"
DoCmd.GoToPage "Page2"
ElseIf Parent!Me!Page= "Page2"
DoCmd.GoToPage "Page3"
'and so on.......................
End Select
End Sub
'==========================

Clumsy, but should work OK for this limited case.
-Ed
"PC Datasheet" <no****@nospam.spam> wrote in message
news:0X****************@newsread3.news.atl.earthli nk.net...
Ed,

Thanks for responding!

I have a single subform with three pages and would like to page through
it. Your code goes through records and I want to go through pages. The
GoToPage method takes page numbers different than the GoToRecord method
that goes to Next and Previous. Any ideas on how to do the same thing
with pages?

Thanks again!

Steve
PC Datasheet
"Ed Robichaud" <ed*********@wdn.com> wrote in message
news:8M***************@monger.newsread.com...
When the focus is in a continuous or datasheet style subform, Page
Up/Dn works as you would expect. I assume you mean the case where the
subform is single-form type and Page Up/Dn only moves within the
current record.

I haven't tested this, but you could try setting the subform's
KeyPreview to True and using the KeyDown event to trap codes 33 and 34,
then using code to move to the next/previous record.

Something like:
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case 33
DoCmd.GoToRecord , , A_NEXT
Case 34
DoCmd.GoToRecord , , A_Previous
End Select
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''

-Ed
"PC Datasheet" <no****@nospam.spam> wrote in message
news:YO****************@newsread3.news.atl.earthli nk.net...
> Is there a way to page through a subform using PageDown and PageUp?
>
> Thanks!
>
> Steve
> PC Datasheet
>



Nov 13 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.