Solved understanding events and going to last record on subform

slharman1

Member
Local time
Yesterday, 18:06
Joined
Mar 8, 2021
Messages
483
I have a form that that has employee info, on it there is a subform with child fields linked to the main form, what i want is for the subform to go to the last record, there is the possibility that there is not a record for the subform until the first record is added for that employee. I am struggling with where to put the goto last record command.
Thanks
 
Hi. You said you want the subform to go to the last record. The question then is "when" do you want that to happen? For example, as soon as the main form opens? As soon as the user goes to a different employee? Etc...
 
As soon as the main form loads because it is filtered to one employee and will close once they complete the time entry.
MSI that leads me to think in load event for the main form?
Thank you
 
Hi. You said you want the subform to go to the last record. The question then is "when" do you want that to happen? For example, as soon as the main form opens? As soon as the user goes to a different employee? Etc...
Thanks, Load event for main form it is.
 
Alternatively, reverse the order of the subform's recordset.
 
If the main form is filtered to only a SINGLE record, then the Load event will work. However, this type of code is more useful in the main form's Current event. That way, it runs whenever the main form moves to a new record rather than just once when the form opens. The choice is to use an event that works in some situations or one that works for all situations.
Main form is filtered to single record.
thanks, would it be good practice to run it on current anyway?
 

Users who are viewing this thread

Back
Top Bottom