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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Force sub form to show most recent records?

Status
Not open for further replies.

gusbrunston

Programmer
Feb 27, 2001
1,234
US
I need your help once more...
Using a sub form to display a journal for clients. Working great, except: When the form opens, the oldest transactions are at the top of the page, requiring the user to scroll down to the current month's entries. The user is almost always interested in seeing the current month's activity when opening the form; but it is useful to be able to scroll up to previous months. Is there a way to display the records starting at the bottom and going up?
Many thanks,
:) Gus Brunston
An old PICKer
padregus@home.com
 
Have the record source for your subform sort descending by the date field your interested in.

Select * from table1 ORDER BY date1 DESC;

Maq B-)
<insert witty signature here>
 
Thank you for your response. Yes, that's one way, but the users are used to looking at transactions with the debits, credits and running balance from the top down, as you would in a checkbook register. We'll see...
:) Gus Brunston
An old PICKer
padregus@home.com
 
What if you set focus (On Current event of your main form) to your subform, go to last record, then if necessary set focus back to your main form. Don't know if it will work, but worth a try?
 
Thank you, &quot;tempclerk&quot;:
You may have pointed me in the right direction, but I haven't been able to get the right syntax. I've tried &quot;FindLast&quot; in the sub form's On Current event, but I can get the syntax past the guards.
I cobbled the following code from looking at some of the code in the main form:
Code:
Set Rs = Me.Recordset.Clone
     Rs.FindLast &quot;[TransactionDate] = '&quot; 
          & Me![TransactionDate] & &quot;'&quot;
     Me.Bookmark = Rs.Bookmark

If you have any other suggestions they will be appreciated...:)
Gus Brunston
An old PICKer
padregus@home.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top