473,406 Members | 2,220 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Pages In Subform

Is there a way to page through a subform using PageDown and PageUp?

Thanks!

Steve
PC Datasheet
Nov 13 '05 #1
5 3612
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Rey | last post by:
Howdy all. Appreciate your help with several problems I'm having: I'm trying to determine if the Visit subform (subformVisits) has a new record or been changed, i.e. dirty. The form that...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
2
by: Brian | last post by:
Greetings! What I am looking for is help trying to accomplish control + tab exiting subform #1 on page #1 and entering the first control (main form) on page #2. I've tried the following code,...
4
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the...
0
by: AccessAl | last post by:
hi: Is there a limit the to the number of subforms and pages that can be used on any one form? On several systems that I use, we have 5 to 7 pages( or tabs). We use subforms on those pages. ...
0
by: Dariusz Tomon | last post by:
Hello I'm trying to do data access pages with subform (containing related data from a table with relationship with the main table). I wonder what is the best method - I tried to do it but all I...
6
by: DMUM via AccessMonster.com | last post by:
Hello I am trying to pass the name of my subform to a function/sub but I can't seem to get it to work. I am using an autokey function (ctrl E) to unlock text boxes on a subform. I have a few...
3
by: kev | last post by:
Hello, I posted a question a while ago on tabbed pages, how to set it to invisible when the text box is empty.It was answered by Rick and the code ran perfectly. However, i tried using the same...
0
by: LEX | last post by:
I Have A Simple 2 Table Database. I Have Created A Form With A Subform, Works Ok. Boss Wants An Online Form So That People Can Update Own Records,(training Records, Skills Etc). Created Access Data...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.