Placing the cursor in a cell in a datasheet form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Does anyone know how I can set the cursor to a particular cell in a
datasheet subform that I have created - I would like to generate some VBA
coding to place the cursor in the 3rd column of the last used row in my
datasheet subform.
 
Dim frm As Form
Dim ctl As Control

Set frm = Me!SubFormControl.Form
Set ctl = frm.txtControl3

frm.Recordset.MoveLast
ctl.SetFocus

Set frm = Nothing
Set ctl = Nothing
 
Almost there. Have tried the code - it selects the last row of my datasheet
subform - rather, doesn't actually select the row, but places the little
black triangle in the record selector on the left hand side of the datasheet
form.

But I reckon we are close here. Any other tips/ideas??
--
 
It worked for me. If the triangle is pointed at the last record then it did
select the last record. If it did not put the cursor in the correct control
you may need to be sure the name of the control is correct and that it can be
selected.
 
Back
Top