automatically view last record in subform

karatelung

Registered User.
Local time
Today, 13:03
Joined
Apr 5, 2001
Messages
84
I want a subform to automatically display the last record when opened ( 14 of 14, etc...).

How can this be acheived? Thanks.
 
On the On_Enter event of the subform,

DoCmd.GotoRecord,,aclast
 
thanks. it worked, but you still have to click somewhere on the subform for it to go to the last record. it's almost the same as clicking on the "go to last record" button, so it doesn't really save a step.

I tried to set the focus on a field on the subform after clicking the tab on which the subform resides.

form: frmReferral
subform: sfrmPlacement
control on sfrmPlacement: PlacementMove

here is what i placed in the "On Click" property of the tab control:

Forms![frmReferral]![sfrmPlacement].Form![PlacementMove].SetFocus

It didn't work. Does anyone know why? It looks like I'm referring to a control on a subform the correct way according to http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q113352&LN=EN-US&SD=gn&FR=0.

Thanks.
 
Set the focus to the subform first, then the control ie.

Forms![frmReferral]![sfrmPlacement].setfocus
Docmd.gotocontrol "PlacementMove"
docmd.gotorecord,,aclast
 

Users who are viewing this thread

Back
Top Bottom