Re: Access 97: Use VBA to find selected column in subform (datasheet view)



I'll admit I tried this in Access 2000, but I *think* it would work in A97
as well.

Clicking in a datasheet subform's header seems to trigger the OnClick event.
And in that event Screen.ActiveControl.Name returns the name of the column
you clicked on.

HTH

"Thomas Zimmermann" <thomas@zinformatik> wrote in message
news:437bb88d$0$41150$14726298@xxxxxxxxxxxxxxxxxx
> I have a form with a subform in datasheet view. Now, I want to trigger a
> procedure (P1) each time the user selects an entire column (by clicking in
> the heading) in the subform. The procedure (P1) I want to trigger needs to
> be called with the selected column as a parameter.
>
> As far as I am aware, there is no event procedure for clicking in the
> heading of a datasheet. So insted I need to start by having an other
> procedure P0, which is triggered in an other maner (maybe from timer,
mouse
> move or?). And then I can let P0 test if a column is selected or not. And
> then if a solumn is selected, P0 should fin a name (or some other
reference)
> for the selected column, and the call my procedure P1.
>
> Now, I have no idea how to read from VBA if a column is selected, and also
I
> have no idea how to find a reference to the selected column. Any ideas?
>
> Thanks in advance
>
> Thomas Zimmermann
>
>


.



Relevant Pages

  • Access 97: Use VBA to find selected column in subform (datasheet view)
    ... I have a form with a subform in datasheet view. ... The procedure I want to trigger needs to ... for the selected column, and the call my procedure P1. ...
    (comp.databases.ms-access)
  • Handle Selected Records
    ... I've got a form in datasheet view. ... trigger an action on the rows that he currently has selected in the ... Dim LeftRS As DAO.Recordset ... Do While Not .EOF ...
    (comp.databases.ms-access)
  • Re: Handle Selected Records
    ... steph wrote: ... I've got a form in datasheet view. ... trigger an action on the rows that he currently has selected in the ... Dim LeftRS As DAO.Recordset ...
    (comp.databases.ms-access)
  • Re: Handle Selected Records
    ... steph wrote: ... I've got a form in datasheet view. ... trigger an action on the rows that he currently has selected in the ... Dim LeftRS As DAO.Recordset ...
    (comp.databases.ms-access)
  • Re: Handle Selected Records
    ... I've got a form in datasheet view. ... trigger an action on the rows that he currently has selected in the ... Dim LeftRS As DAO.Recordset ... Do While Not .EOF ...
    (comp.databases.ms-access)