| 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@news.sunsite.dk...[color=blue]
> 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,[/color]
mouse[color=blue]
> 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[/color]
reference)[color=blue]
> 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[/color]
I[color=blue]
> have no idea how to find a reference to the selected column. Any ideas?
>
> Thanks in advance
>
> Thomas Zimmermann
>
>[/color] |