Datasheet view Column Header (1 Viewer)

Kenln

Registered User.
Local time
Today, 10:14
Joined
Oct 11, 2006
Messages
551
Is there anyway to detect a click on a Column Header in Datasheet view.

I would like to sort based on clicking the column header.

Thank you in advance.
 

Kenln

Registered User.
Local time
Today, 10:14
Joined
Oct 11, 2006
Messages
551
Oops, I should also have said...

I turn off the menu bars. I wish to sort via code, which I can do. But I don't know the event, if there is one, that triggers when one clicks on the Column Header.
 

Bodisathva

Registered User.
Local time
Today, 10:14
Joined
Oct 4, 2005
Messages
1,274
But I don't know the event, if there is one, that triggers when one clicks on the Column Header.
Form_MouseDown is triggered anytime the user clicks anywhere on the form
 

Kenln

Registered User.
Local time
Today, 10:14
Joined
Oct 11, 2006
Messages
551
Will this tell me which column header was clicked?
 

Bodisathva

Registered User.
Local time
Today, 10:14
Joined
Oct 4, 2005
Messages
1,274
Will this tell me which column header was clicked?
it will pass you the coordinates of the click, so technically if you know the column widths, you can extrapolate the column clicked. I was unable (in my admittedly brief search) to find a way to locate the highlighted column in datasheet view.
 

Kenln

Registered User.
Local time
Today, 10:14
Joined
Oct 11, 2006
Messages
551
Thanks for your help.

I'll keep looking,
 

twosides

Registered User.
Local time
Today, 07:14
Joined
Jul 19, 2005
Messages
38
I have a solution, are you still looking or did you find an answer?
Cheers
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 09:14
Joined
Feb 28, 2001
Messages
27,410
In a form in datasheet view, you can place event code. I believe that the column header counts as a label (not going to swear to that). If that is true, you can do an OnClick event with a label. Open the form in datasheet view and switch to design mode. See if you can select the header. If you can, you have a chance. If not, ...
 

rockman

Senior Member
Local time
Today, 07:14
Joined
May 29, 2002
Messages
190
twosides,

I'm looking for your solution to this thread. Can you elaborate?

Thanks,
Jeff
 

Kenln

Registered User.
Local time
Today, 10:14
Joined
Oct 11, 2006
Messages
551
Twosides, yes definately!

Rockman,
I have a Form that displays in DataSheet. I am turning off the menu bars. I would like to have the user click (or double click) the column header an have that column sort.

Right now I solved it by having the user double click on any record in the field to be sorted. But most people try to double click the header which seems more natural.
 

neileg

AWF VIP
Local time
Today, 15:14
Joined
Dec 4, 2002
Messages
5,975
If you used a continuous form instead of a datasheet, you have all the events in the column label.
 

Users who are viewing this thread

Top Bottom