Solved

How do I retrieve the previous and next rows in an Access database usng a query?

Posted on 2008-06-23
2
198 Views
Last Modified: 2013-11-28
I have a database that lists a large amount of production jobs for the my company.  I order the rows by job number, but I was wondering how to accomplish this task with a query so I could end up putting all this information on a report.

What I want to do is grab the previous and next row's job number of the row that is currently populating the report.

For example, if I am looking at the report for job number 5, I want to put fields on the report that would list the previous and next job number in the database (maybe 4 and 6).  This is so the user knows where the jobs was and where it is headed.

What would be the best route to accomplish this task?

Thanks.
0
Comment
Question by:zrancidr
2 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
ID: 21849640
see this link for several ways

http://support.microsoft.com/?kbid=210504
0
 

Author Closing Comment

by:zrancidr
ID: 31469911
Looks like that has everything I could want.  Thanks for the quick answer!
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now