Results 1 to 5 of 5
  1. #1
    Robert M is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2009
    Posts
    23

    Moving through records via Page Down

    I have a subform that diplays 6 records in the open window. I have place record movement buttons to help the oporator move through the form (I.E. First record, Previous Record, Next Record, Last Record) This works to a point. I need to be able to have the Previous Record and Next record move the cursor to the First Record of the next page. or the first record of the Previous Page. I have tried the
    "DoCmd.GoToRecord,,acNext, 6"
    and
    "DoCmd.GoToRecord,,acPrevious,6"
    This does well but skips displaying some records.
    I have found manually using the Page Up and Page Down works excellently so how do I program the Prev Rec Next Rec buttons to do this.



    Thank you for your help.

    Robert M

  2. #2
    tlittell is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2009
    Location
    Pittsburgh, PA
    Posts
    8
    Try this. It will cycle through records on a bound form using pageup/pagedown button on your keyboard. Not sure this is exactly what you are trying to accomplish, but should get you started.

    Code:
     
    Private Sub form1__keydown(keycode As Integer, shift As Integer)
    If keycode = vbpagedown Then DoCmd.GoToRecord , , acNext
    If keycode = vbpagedown Then DoCmd.GoToRecord , , acPrev
    End Sub

  3. #3
    Robert M is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2009
    Posts
    23
    Thank you tlittel. I'm sorry that I might not have been clear in my text. What I am wanting is not so much to use the keypad (except as a last resort) but a button code that will allow me to skip to the next set of records. However, I do thank you for the information you have given me. Any information I get helps for future programming.

    Robert M

  4. #4
    tlittell is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2009
    Location
    Pittsburgh, PA
    Posts
    8
    Try this. Be sure to setfocus on the subform you want to page through. Assign SendKeys "{PGUP}" to another button.

    Code:
     
    Private Sub Command4_Click()
    Child1.SetFocus 'important
    SendKeys "{PGDN}"
    End Sub
    Let me know if that works for you.

  5. #5
    Robert M is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2009
    Posts
    23
    Thanks again for clearing it up. I will need to research on setfocus as well as Child1 But I do understand better what you mean.

    Thanks again

    Robert M

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Help with Moving names
    By Mcinsane in forum Access
    Replies: 1
    Last Post: 06-04-2009, 01:04 PM
  2. Moving Information from One Form to Another
    By bsharpbyoung in forum Forms
    Replies: 2
    Last Post: 03-22-2009, 09:37 PM
  3. Moving Records Between Databases
    By sscott in forum Access
    Replies: 2
    Last Post: 03-22-2009, 09:08 PM
  4. Replies: 0
    Last Post: 02-11-2009, 06:43 PM
  5. Select query for Exponential Moving Average.
    By krishna79 in forum Queries
    Replies: 0
    Last Post: 01-22-2009, 05:52 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums