Another developer using iGrid in MS Access, Eckhard Petersen, found a solution to this problem. He found that declaring iGrid with the WithEvents modifier (see
this post ) and setting the Enabled property through this strongly-typed object reference helps to solve the problem:
' Declare on form module level
Private WithEvents xGrid as iGrid
' Init xGrid var somewhere before use
Set xGrid = iGrid0.Object
' Disable iGrid properly
xGrid.Enabled = False
There is an explanation of this trick. When we write
, actually we call the Enabled property provided by MS Access for all form controls, but this is not the Enabled property implemented in iGrid itself. MS Access does its own work to disable the control, but in the case of iGrid that has other nested API controls it has the described bad side effect.
The nature of this problem is the same as it is explained in this forum post:
GridlineColor not working in MS-Access Taking into account the above post, you can also use an equivalent 1-line solution to disable iGrid the right way:
iGrid0.Object.Enabled = False
However, note that the WithEvents trick described at the beginning of the post is a better way to solve this problem as it also allows you to avoid problems related to missing iGrid events.