By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,968 Members | 1,247 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,968 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Nov 16 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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:43***********************@news.sunsite.dk...
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

Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.