Setting SourceObject of the subform holding crosstab datasheet failed activeControl (1 Viewer)

g q

New member
Local time
Today, 00:28
Joined
Feb 16, 2010
Messages
4
I have a main form containing a subform control that is related to a subform based on a crosstab query. The crosstab query column header and its value records are inserted by the user at run time through a textbox and a button on the main form(but only one field selected as the column header in crosstab SQL).

To show the newly added column header records on the right hand side of the subform, I set subform's sourceobject, which works well to display the runtime added records. Together I also hide some columns to allow sorting any number of column conbination. From display the run time added records standpoint, it works well.

That said, since user may click an existing column header to make a copy of its header and its value records, while the screen.activecontrol failed to catch the clicked column header name even with requery, refresh or repaint used. Without a way to detect which column is clicked, there is no way to make copy of the records insert into the database.

The screen.activecontrol only works for mouse clicking on the initial queried column header record immediately after the design time, not on the dynamically queried corsstab column header/record on the subform datasheet. The subform's Form_Click event simply failed to respond.

While the mouse clicking still highlighted the column header, clicking the menu sort A-Z button still works. That means the MS Access 2002 could detect the clicked column header. Any VBA guru could shed some light on this coding?

I am doing the prototype now. Company still uses MS Access 2002.

Any help would be very much appreciated.

John
 

Users who are viewing this thread

Top Bottom