Skip to content

Moving Focus to Last Record in a Subform

How to make the cursor go to the first column in the new record row.

Q:  Henry W. writes that he needs to move the cursor to the first column in the new record row of a datasheet subform, from the AfterUpdate event of a combo box that assigns a record source to the subform.  He has tried using SendKeys, but without success – no error message, but the cursor doesn’t move to the right place.

A:  You can make the cursor go to the first column in the new record row using the GoToRecord method of the DoCmd object, after setting the focus on the subform, as in the code listed below:

   Me![subResults].SetFocus

   DoCmd.GoToRecord record:=acNewRec

   Me![subResults]![txtID].SetFocus

About this author

Office 2024 - all you need to know. Facts & prices for the new Microsoft Office. Do you need it?

Microsoft Office upcoming support end date checklist.