Solved Continuous Form last row (1 Viewer)

ClaraBarton

Registered User.
Joined
Oct 14, 2019
Messages
506
I found this from Arnelgp:
Code:
Sub ShowLastRows()
    With Me.Recordset 'use the recordset in the form, not the clone[/COLOR]
        .MoveLast     'move to the last record, shows at top of list[/COLOR]
        .Move -19     'move up 19, shows more records, last row moves down[/COLOR]
        .MoveLast     'move last again, highligh moves to bottom[/COLOR]
    End With
End Sub
If I put it in the OnLoad event, it works well. But I'd like to have my register always look this way.
If I put it in the Current event... Just mess. Each line calls the current event again and I end up with a stack overflow.
How would I fix this?
 
I want to show the last rows in a continuous form and enter new transactions at the bottom... like Quicken.
 
I want to show the last rows in a continuous form and enter new transactions at the bottom... like Quicken.
You said that code works in the Load event. Can you post a screenshot of your form to show what it looks like after the code ran? Does it show the blank row?
 
My quicken goes back to what ever record you were on in any particular account?
Add a button to call that code as and when you want it?
 
1712337797578.png
 
Okay, I can see the blank row at the bottom where you'll enter new records, which is what you said you wanted. I am not familiar with Quicken, so what behavior are you trying to copy? What happens now when you enter a new record and what do you want to happen instead?
 
I want it to always be that way, so if I filter the form, or edit a previous record, or add a new record, go back to this way. Current cannot work.
 
If you want the form to always filter the records using the last record (which is also the Maximum Date in the Date field), then just open the Record Source query and filter it using the Maximum Date in the Date field criteria box. The form will then only show the last record (latest date) and blank new fields.
 
No. I want the all records from the account on the form but to show the most recent 19 (available landscape) records with the new record to be added at the bottom (ascending). Or maybe descending...whatever. Sorting the query in ascending order leaves the form empty except for the last record. Sorting with the newest record at the top requires going through all records to reach the bottom to add a new record.
 
Last edited:
I want it to always be that way, so if I filter the form, or edit a previous record, or add a new record, go back to this way. Current cannot work.
No, the Current event doesn't work, but have you tried using the ApplyFilter event?
 
Why would that work? Wouldn't that require a button? I want it to always be this way... that's why I though current would work.
 
Why would that work?
I just gave it a try, and I had to involve the timer event, because the apply filter triggers before the form actually displays the new sort or filter. You should give it a try to see how that works.

If you need help implementing it, consider posting a sample db with test data.
 
Not exactly sure what you are saying. But maybe.

Modify the form you show so that the detail section is a subform. It should look identical except you will have a scroll bar. Then you have a second subform that looks identical to the other subform but that is in addnew. So it is a single row. Put that in the the footer or header for adding new records. You will never have to scroll.

The entry "subform" could also be controls on the main form either bound or unbound. Most people would put that in the header so you always add new records at the top of the form, but either way you never scroll.
 
Here is an example from the web. They used unbound controls at the top of the form to add records. You could do something similar to show last entered record or add record.
unbound.png


 
Ok... I had it set up with unbound controls first but I saw this code and it looked like just what I wanted. I've added a sample if you want to look at it. Click on Transactions on the opening menu
 

Attachments

Ok... I had it set up with unbound controls first but I saw this code and it looked like just what I wanted. I've added a sample if you want to look at it. Click on Transactions on the opening menu
I'll take a look as soon as I'm in front of a computer.

Sent from phone...
 
Ok... I had it set up with unbound controls first but I saw this code and it looked like just what I wanted. I've added a sample if you want to look at it. Click on Transactions on the opening men
I looked, but I have no idea what that demonstrates. You pop open a form and move to the last record. Is that what you wanted? I would not have guessed that is what you were asking.
 

Users who are viewing this thread

Top Bottom