473,794 Members | 2,774 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3630
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(Ke yCode As Integer, Shift As Integer)
Select Case KeyCode
Case 33
DoCmd.GoToRecor d , , A_NEXT
Case 34
DoCmd.GoToRecor d , , A_Previous
End Select
End Sub
''''''''''''''' ''''''''''''''' ''''''''''''''' '''''''''''''

-Ed
"PC Datasheet" <no****@nospam. spam> wrote in message
news:YO******** ********@newsre ad3.news.atl.ea rthlink.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*********@wd n.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(Ke yCode As Integer, Shift As Integer)
Select Case KeyCode
Case 33
DoCmd.GoToRecor d , , A_NEXT
Case 34
DoCmd.GoToRecor d , , A_Previous
End Select
End Sub
''''''''''''''' ''''''''''''''' ''''''''''''''' '''''''''''''

-Ed
"PC Datasheet" <no****@nospam. spam> wrote in message
news:YO******** ********@newsre ad3.news.atl.ea rthlink.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(Ke yCode 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******** ********@newsre ad3.news.atl.ea rthlink.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*********@wd n.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(Ke yCode As Integer, Shift As Integer)
Select Case KeyCode
Case 33
DoCmd.GoToRecor d , , A_NEXT
Case 34
DoCmd.GoToRecor d , , A_Previous
End Select
End Sub
''''''''''''''' ''''''''''''''' ''''''''''''''' '''''''''''''

-Ed
"PC Datasheet" <no****@nospam. spam> wrote in message
news:YO******** ********@newsre ad3.news.atl.ea rthlink.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*********@wd n.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(Ke yCode 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******** ********@newsre ad3.news.atl.ea rthlink.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*********@wd n.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(Ke yCode As Integer, Shift As Integer)
Select Case KeyCode
Case 33
DoCmd.GoToRecor d , , A_NEXT
Case 34
DoCmd.GoToRecor d , , A_Previous
End Select
End Sub
''''''''''''''' ''''''''''''''' ''''''''''''''' '''''''''''''

-Ed
"PC Datasheet" <no****@nospam. spam> wrote in message
news:YO******** ********@newsre ad3.news.atl.ea rthlink.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!My Sub.form!MyCont rol 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******** *********@newsr ead1.news.atl.e arthlink.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*********@wd n.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(Ke yCode 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******** ********@newsre ad3.news.atl.ea rthlink.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*********@wd n.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(Ke yCode As Integer, Shift As Integer)
Select Case KeyCode
Case 33
DoCmd.GoToRecor d , , A_NEXT
Case 34
DoCmd.GoToRecor d , , A_Previous
End Select
End Sub
''''''''''''''' ''''''''''''''' ''''''''''''''' '''''''''''''

-Ed
"PC Datasheet" <no****@nospam. spam> wrote in message
news:YO******** ********@newsre ad3.news.atl.ea rthlink.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
24877
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 contains the subform is named Clients. I have this code in the Add Client btn: If Forms!Clients.subformVisits!VisitDirty = True Then MsgBox "Visit subform is dirty!"
25
10268
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 data in each record, which includes the ID of the father and the mother (who also have records in the table). One record per form. I have a Tab Control in the form, and in one of the tabs I have a subform (sfmSiblings) in which I wish to list...
2
1519
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, however it seems to "fire twice", placing me at the first control on subform #2 on page #3, totally skipping page #2. It seems to very briefly stop the control on page two, but keeps going. Hope that made sense. Key preview for subform is set to...
4
7020
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 user enters the last qualifying field on the main form. In one case this works fine, the subform shows the data the user wants to update -- which means showing all the data put in previously (ie showing this via the requery and the continuous...
0
1258
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. What has happened is when trying to load the main form, it seems to take forever for the data to appear. I am assuming that the problem is linking the forms to the tables, but waiting over 5 minutes for a very small database (largest table contains...
0
1269
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 achieved was error when I tried to change data (storing in related table). Error message: Insufficient key column information for updating or refreshing Any piece of advice?
6
5979
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 forms in the database that will use this function, so I need to be able to tell the code which form to unlock. What I have is as follows: Public Function akeyEdit()
3
2774
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 code for another scenario and it gives me compile error:method or data member not found. My scenario is i have a nested tab page.My main tabbed page has 4 tabs, About, SafetyLevel1,SafetyLevel2,SafetyLevel3. Inside this main, i created a...
0
1068
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 Page But Does Include Subform Page. How Do I Include Subform As A Page, (refers To Sublevel Object?) Access Instructions Online Are Vague. If I Can Include Subform In New Page, Can I Restrict Access To That Persons Own Record, Or Will They Be...
0
9672
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10435
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10163
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6779
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.