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

Goto last record of subform automatically 1

Status
Not open for further replies.

xplo5iv

Technical User
Jan 5, 2005
75
GB
Hi

I have a subform with timesheet information. When it's refreshed I wan't it to go to the last record. On a previous form I've used
Code:
  DoCmd.GoToRecord , , acLast
  DoCmd.GoToRecord , , acPrevious, 7
  DoCmd.GoToRecord , , acLast
But I can't get it to work on the subform.
If I use
Code:
DoCmd.GoToRecord , Forms.frmTimesheet2.Form.frmsubTimesheet.Name, acLast
I get an error telling me the subform isn't open!

Help!

Thanks in Advance

Jonathan
 
Hi
If you use:
Code:
DoCmd.GoToControl "frmTimesheet2"
DoCmd.GoToRecord , , acLast
Where frmTimesheet2 is the name of the subform control, I think it should work.
 
Thanks Remou

The subform was frmsubTimesheet, and now the following works perfectly, displaying the last 7 entries as required

Thanks for the help!

Code:
 DoCmd.GoToControl "frmsubTimesheet"
DoCmd.GoToRecord , , acLast
DoCmd.GoToRecord , , acPrevious, 7
DoCmd.GoToRecord , , acLast


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top