Asked by:
Check if user has selected the record selector itself

Question
-
In a Datasheet you have the individual cells, and the record selector. If the user is inside a cell, I don't want to know. When you click on a record selector, the entire row is highlighted. Is there any way to test of the record selector has the focus or is clicked?Thursday, July 6, 2017 1:45 PM
All replies
-
I just thought of a related question. Is it possible to tell if the user has selected a group of records by using the record selector, or perhapse itorate through those selected records items in the underlying recordset or something?Thursday, July 6, 2017 3:17 PM
-
Hi,
Just thinking out loud... Try checking the SelHeight (I think) property.
- Proposed as answer by Deepak Saradkumar PanchalMicrosoft contingent staff Friday, July 7, 2017 2:43 AM
Thursday, July 6, 2017 3:21 PM -
Yes, the Form's SelHeight does give me the count of records selected in a datasheet. Thanks DbGuy.
Notes: It isn't exclusive to the record selectors(which is fine for me, just a heads up to others). If the cursor is inside a cell, SelHeight = 0. If a cell is selected by clicking on its boarder, but the insertion point is not in the cell, SelHeight = 1. Which means if a use selects multiple cells SelHeight will be the number of records over which that selection is spanning.
With this info I've tried this technique:
First, if I select multiple records and get a reference to Screen.ActiveForm, it returns the first record selected. Which means if you select a record and drag UP its the bottom record with the focus, DOWN and its the top record with the focus. I was thinking I could scan the Recordset object by getting a reference to the Id on the record but now I don't know whether the user dragged up, or down while selecting the records.
I can tell if the Record is selected, which answers my original question. Any ideas on how to tackle knowing if user dragged up or down while selecting multiple records? Or another way to figure that out?- Edited by HTHP Thursday, July 6, 2017 5:11 PM
Thursday, July 6, 2017 5:09 PM -
Just thinking out loud again... To determine if the user dragged down or up, you might be able a combination of MouseDown and MouseUp events.
Hope it helps...
- Proposed as answer by Deepak Saradkumar PanchalMicrosoft contingent staff Friday, July 7, 2017 2:44 AM
Thursday, July 6, 2017 5:17 PM