RaymondC
  • RaymondC
  • Advanced Member Topic Starter
2015-02-20T00:24:16Z
I have a grid on an Access 2010 form. On this form, I created a procedure called PopulateList() which fills the grid with data and uses automatic grouping. In the AfterAutoGroupRowCreated event, I change the color and text of the group rows.

This procedure is called from many other procedures. For example: when the form first loads, when the user presses a "Refresh Data" button, when a new record is created, etc. All of those calls work properly. The list is filled with the data, the data is grouped, and the AfterAutoGroupRowCreated procedure properly formats the group rows.

The problem happens when I call the PopulateList() procedure from the grid's DblClick event.

#1 The grid is filled with data - good
#2 The data is grouped - good
#3 The AfterAutoGroupRowCreated event does not work
RaymondC
  • RaymondC
  • Advanced Member Topic Starter
2015-02-20T01:35:27Z
I did some more testing...

I put a new grid on an Access 2010 form. The grid is empty when the form opens.
In the grid's DblClick event, I put some code to fill the grid with data and create automatic grouping.
In the grid's AfterAutoGroupRowCreated event, I put some code to change the group row color.

When I double click the grid, it fills with data and creates the group rows but the AfterAutoGroupRowCreated event will not fire.
Igor/10Tec
2015-02-20T06:59:58Z
Have you tried this with the latest iGrid (5.0.105)? As I remember, we fixed a bug related to this problem or something like that.

If this does not help, send us a sample we can use to reproduce the problem.
RaymondC
  • RaymondC
  • Advanced Member Topic Starter
2015-02-20T16:56:58Z
I will try the latest version and report back.

To upgrade, I replace the old .ocx file with the new one but do I also need to re-register the new version?
RaymondC
  • RaymondC
  • Advanced Member Topic Starter
2015-02-20T22:20:57Z
The new version does not help. The attached database shows the problem.

Fill the list with the "Refresh" button and the AfterAutoGroupRowCreated event fires.
Fill the list by double-clicking the grid and the AfterAutoGroupRowCreated event will not fire.

Thanks.
File Attachment(s):
GridTest.zip (37kb) downloaded 123 time(s).
Igor/10Tec
2015-02-23T16:40:56Z
iGrid is written in VB6, so I recreated your sample in VB6 and tried to debug it in this native environment. The code worked without any problems.

Ok, another try - now in VBA in MS Excel. The code also worked as expected.

Looking at all this, I can conclude that it is a specific problem (bug) of MS Access. And frankly speaking, I see no way how we can fix it from our side.
Igor/10Tec
2015-02-23T16:48:22Z
I remembered that earlier someone had also reported a problem with the AfterAutoGroupRowCreated event in MS Access. I searched the forum, and found your post ;)

http://10tec.com/Forum/y...eated-event-problem.aspx 

It seems, MS Access does not 'love' this event and I do not know why. Only the developers of MS Access can answer this question.
RaymondC
  • RaymondC
  • Advanced Member Topic Starter
2015-02-23T20:32:13Z
I do remember that earlier post but in that case there was a workaround of using the OnLoad event instead of the OnOpen event and everything worked great.

In this case, I cannot find an acceptable workaround. I understand it is a bug with MS Access but maybe there is some workaround? Would it be possible for me to call the AfterAutoGroupRowCreated myself? Or I suppose I could just loop through all the rows and when I find a group row then apply the formatting.
Igor/10Tec
2015-02-24T13:09:38Z
Originally Posted by: RaymondC 

Or I suppose I could just loop through all the rows and when I find a group row then apply the formatting.



Yes, I do not know other solutions.

Perhaps, the universal way to do that for all cases is to place this code in the AfterContentsGrouped event.
Igor/10Tec
2016-11-10T11:30:19Z
One of the developers has found a solution to the problem with iGrid events not fired in some cases. Read this KB article:

iGrid events are not always raised in MS Access 
RaymondC
  • RaymondC
  • Advanced Member Topic Starter
2016-11-10T16:51:45Z
Thanks for the update.