[AccessD] Datasheet view selection question

A.D.Tejpal adtp at touchtelindia.net
Thu Dec 8 06:30:05 CST 2005


Bobby,

    You can put the sample subroutine (P_SelectEntireRow()) given below, in your form's module and call it from enter events pertaining to controls representing various columns.

    With this, as you navigate through the datasheet, entire row for the current record will remain selected.

    On the other hand, if you wish the current row to be highlighted in a special color, my sample db named HighLightDataSheetRows might be of interest to you. It is available at Rogers Access Library (other developers library). Link - http://www.rogersaccesslibrary.com

    You could adapt the underlying approach suitably, for your specific needs.

Best wishes,
A.D.Tejpal
--------------

=====================================
Private Sub P_SelectEntireRow()
    Me.SelLeft = 1
    Me.SelHeight = 1
    Me.SelWidth = Me.Detail.Controls.Count
End Sub
=====================================

  ----- Original Message ----- 
  From: Bobby Heid 
  To: 'Access Developers discussion and problem solving' 
  Sent: Monday, December 05, 2005 21:05
  Subject: [AccessD] Datasheet view selection question


  Hey,

  I have a form that returns selected results.  The users are wanting to be able to re-arrange columns, sort on a given column(s), etc.  They then click on one of several other buttons to be taken to a form related to the selected record.

  I have been using a listview control to display the data.  The users would pre-select the sort order on zero or more fields from several combo boxes.
  But after looking at it, I think we could use a form using a datasheet view.
  Playing with it, I am able to move columns, sort, etc.  But one thing they want is to have the whole line selected when the select a record.  Just as if you had clicked on the little selection box to the left of each record.

  Does anyone know how to select the whole line when one of the fields has been clicked?

  Thanks,
  Bobby



More information about the AccessD mailing list