Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2002
    Posts
    72

    Unanswered: looping through records

    Hello,

    I have a continual form which displays many records at once. Each record has a date field in it and the records are ordered by date. What I need to be able to do is loop down to the first record that contains the current date. But I need to also be able to scroll back up or down if necessary so I can see records with an earlier or later date.

    I need something like this but are not sure of the correct syntax:

    DISPLAY RECORDS IN ORDER OF DATE
    LOOP UNTIL THE DISPLAYED RECORDS DATE = CURRENT DATE
    NEXT RECORD
    END LOOP

    Thanks in advance.

  2. #2
    Join Date
    Apr 2002
    Location
    Germany
    Posts
    228
    you can use the findrecord method of the docmd object to move to a record matching a criteria:

    me.mydatecontrol.setfocus
    'findrecord searches the current field (or all fields which is very slow)
    docmd.findrecord Date()

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •