Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2003
    Location
    Hertfordshire, England
    Posts
    78

    Unanswered: Access the Previous Record with Missing ID Number

    I am trying to perform calculations in a report using data from the current record and the previous record to it. I found this MS article which helps me access the previous record and that works fine. The problem is if I delete a record from the table then that ID number will be missing so record numbering will be similar to 1,2,3,5,6 etc missing 4. If I then run my report I get blank fields because on the record which looks back at the missing record it won't find the previous ID in this case ID 5 - 1 should be 4 which isn't there.

    Do you know of anyway I can get it to look back until it finds the previous ID (or just the previous record) even if several rows are missing?

    If you need me to explain that a bit more clearly please ask.

    Thanks

    Neil.

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Are you dealing with an autonumber field? If so, that's not how autonumber works...

    If you're using a query method similar to the one described, you could look for:

    DMax("yourKeyField", "yourTable", "yourKeyField < " & forms!keyField)
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Sep 2003
    Location
    Hertfordshire, England
    Posts
    78
    Hi

    Thanks for your reply, that looks like it may help me. I will try and let you know.

    Yes it is a auto number field.

    Neil.

  4. #4
    Join Date
    Sep 2003
    Location
    Hertfordshire, England
    Posts
    78

    Thumbs up It Works !

    Thanks you so much, your solution worked well so I now have no blank fields.

    Thanks

    Neil.

Posting Permissions

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