Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show First & Last Record in a table on a single form

Status
Not open for further replies.

DJRobbieBAtl

Technical User
Jun 17, 2004
5
US
What I'm wanting to do is write code for an unbound form that when opened has two fields. The first field will show the record number of the first record in a table and the second field will show the last record number in the same table. What I'm hoping to accomplish is at the end of the month I can see the starting and ending record number in a table that I have added records to all month long. The record number is an auto-number field so when I clear the data at the end of the month, it still starts with the next sequential record number when adding records for the new month.

Aug - Records 1 through 25 used
Sep - Records 26 through 30 used
Oct - Records 31 through 43 used
Etc...

Thanks in advance to anyone who can help!
DJRob

 
Look at the DMax and DMin functions. One will be for one textbox, and the other for the second.

An alternate solution is to create a UNION query with two halves: one that returns the FIRST record with given criteria, and the other half that returns the LAST record with the same criteria.

Frankly, DMax and DMin are easier, provided you are clear with your criteria.
 
The record number is an auto-number
WARNING: you have NO WARRANTY that you don't have gaps (holes) in the sequence numbers ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top