Focus stay on datasheet

A

andifebr

Hi All,
I created one main form with a subform (datasheet view).
and I wonder if someone can tell me how to to make the datasheet
selected rows (lets say the first 5 rows) keep focus when we move to
another control for example a button on the main form.
any help would be very much appreciated.

TIA
Andi
 
A

Arvin Meyer [MVP]

You cannot keep them selected when you move off the subform, but you can use
the SelTop and SelHeight properties to refer to them on the subform:

Me.NameOfSubform.Form.SelTop = 1
Me.NameOfSubform.Form.SelHeight = 5

That should select the first 5 rows in the first column. Use the SelWidth
property to select the number of columns.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top