Solved Continuous Form last row (1 Viewer)

ClaraBarton

Registered User.
Local time
Today, 11:32
Joined
Oct 14, 2019
Messages
479
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?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 11:32
Joined
Oct 29, 2018
Messages
21,494
What exactly are you trying to achieve?
 

ClaraBarton

Registered User.
Local time
Today, 11:32
Joined
Oct 14, 2019
Messages
479
I want to show the last rows in a continuous form and enter new transactions at the bottom... like Quicken.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 11:32
Joined
Oct 29, 2018
Messages
21,494
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?
 

Gasman

Enthusiastic Amateur
Local time
Today, 19:32
Joined
Sep 21, 2011
Messages
14,350
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?
 

ClaraBarton

Registered User.
Local time
Today, 11:32
Joined
Oct 14, 2019
Messages
479
1712337797578.png
 

theDBguy

I’m here to help
Staff member
Local time
Today, 11:32
Joined
Oct 29, 2018
Messages
21,494
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?
 

ClaraBarton

Registered User.
Local time
Today, 11:32
Joined
Oct 14, 2019
Messages
479
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.
 

LarryE

Active member
Local time
Today, 11:32
Joined
Aug 18, 2021
Messages
592
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.
 

ClaraBarton

Registered User.
Local time
Today, 11:32
Joined
Oct 14, 2019
Messages
479
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:

theDBguy

I’m here to help
Staff member
Local time
Today, 11:32
Joined
Oct 29, 2018
Messages
21,494
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?
 

ClaraBarton

Registered User.
Local time
Today, 11:32
Joined
Oct 14, 2019
Messages
479
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.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 11:32
Joined
Oct 29, 2018
Messages
21,494
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.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 14:32
Joined
May 21, 2018
Messages
8,554
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.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 14:32
Joined
May 21, 2018
Messages
8,554
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


 

ClaraBarton

Registered User.
Local time
Today, 11:32
Joined
Oct 14, 2019
Messages
479
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

  • Sample.accdb
    3.1 MB · Views: 25

theDBguy

I’m here to help
Staff member
Local time
Today, 11:32
Joined
Oct 29, 2018
Messages
21,494
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...
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 14:32
Joined
May 21, 2018
Messages
8,554
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.
 

ClaraBarton

Registered User.
Local time
Today, 11:32
Joined
Oct 14, 2019
Messages
479
ok... watched the video. I'll rethink my form. Thank you for all your help.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 11:32
Joined
Oct 29, 2018
Messages
21,494

Attachments

  • Sample (2).zip
    984.1 KB · Views: 28

Users who are viewing this thread

Top Bottom